Struct RouteCache
pub struct RouteCache { /* private fields */ }Expand description
LRU-based route cache for high-performance routing
Implementations§
§impl RouteCache
impl RouteCache
pub fn new(max_size: usize) -> RouteCache
pub fn new(max_size: usize) -> RouteCache
Create a new route cache with specified maximum size
pub fn get(&mut self, topic: &str) -> Option<&Vec<RouteCacheEntry>>
pub fn get(&mut self, topic: &str) -> Option<&Vec<RouteCacheEntry>>
Get cached handlers for a topic
pub fn put(&mut self, topic: String, entries: Vec<RouteCacheEntry>)
pub fn put(&mut self, topic: String, entries: Vec<RouteCacheEntry>)
Store handlers for a topic in the cache
pub fn clear(&mut self)
pub fn clear(&mut self)
Clear the entire cache
pub fn statistics(&self) -> CacheStatistics
pub fn statistics(&self) -> CacheStatistics
Get cache statistics
Trait Implementations§
§impl Default for RouteCache
impl Default for RouteCache
§fn default() -> RouteCache
fn default() -> RouteCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for RouteCache
impl RefUnwindSafe for RouteCache
impl Send for RouteCache
impl Sync for RouteCache
impl Unpin for RouteCache
impl UnwindSafe for RouteCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more