Struct MultiLevelCache
pub struct MultiLevelCache { /* private fields */ }Expand description
Multi-level cache system
Implementations§
§impl MultiLevelCache
impl MultiLevelCache
pub fn new() -> MultiLevelCache
pub fn new() -> MultiLevelCache
Create a new multi-level cache with default configuration
pub fn with_config(
l1_config: CacheLevelConfig,
l2_config: CacheLevelConfig,
l3_config: CacheLevelConfig,
) -> MultiLevelCache
pub fn with_config( l1_config: CacheLevelConfig, l2_config: CacheLevelConfig, l3_config: CacheLevelConfig, ) -> MultiLevelCache
Create a new multi-level cache with custom configuration
pub fn get(&self, key: &str) -> Option<Arc<dyn MessageHandler>>
pub fn get(&self, key: &str) -> Option<Arc<dyn MessageHandler>>
Get handler from cache
pub fn put(&self, key: String, handler: Arc<dyn MessageHandler>)
pub fn put(&self, key: String, handler: Arc<dyn MessageHandler>)
Put handler into cache
pub fn statistics(&self) -> MultiLevelCacheStatistics
pub fn statistics(&self) -> MultiLevelCacheStatistics
Get comprehensive statistics
pub fn clear(&self)
pub fn clear(&self)
Clear all cache levels
Trait Implementations§
§impl Default for MultiLevelCache
impl Default for MultiLevelCache
§fn default() -> MultiLevelCache
fn default() -> MultiLevelCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for MultiLevelCache
impl RefUnwindSafe for MultiLevelCache
impl Send for MultiLevelCache
impl Sync for MultiLevelCache
impl Unpin for MultiLevelCache
impl UnwindSafe for MultiLevelCache
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