pub struct MultiLevelCache<K: Clone + Eq + Hash, V: Clone> { /* private fields */ }Expand description
A two-level cache hierarchy.
L1 is a small, fast LRU cache. L2 is a larger LRU cache. On a miss in L1, L2 is checked and the result is promoted to L1.
Implementations§
Source§impl<K: Clone + Eq + Hash, V: Clone> MultiLevelCache<K, V>
impl<K: Clone + Eq + Hash, V: Clone> MultiLevelCache<K, V>
Sourcepub fn insert_l2_only(&mut self, key: K, value: V)
pub fn insert_l2_only(&mut self, key: K, value: V)
Insert only into L2 (for pre-warming the L2 cache).
Sourcepub fn total_requests(&self) -> u64
pub fn total_requests(&self) -> u64
Total requests served.
Auto Trait Implementations§
impl<K, V> Freeze for MultiLevelCache<K, V>
impl<K, V> RefUnwindSafe for MultiLevelCache<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for MultiLevelCache<K, V>
impl<K, V> Sync for MultiLevelCache<K, V>
impl<K, V> Unpin for MultiLevelCache<K, V>
impl<K, V> UnsafeUnpin for MultiLevelCache<K, V>
impl<K, V> UnwindSafe for MultiLevelCache<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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