pub struct StatCache<K: Hash + Eq + Clone, V: Clone> {
pub inner: SimpleLruCache<K, V>,
pub hits: u64,
pub misses: u64,
}Expand description
A counted-access cache that tracks hit and miss statistics.
Fields§
§inner: SimpleLruCache<K, V>The inner LRU cache.
hits: u64Number of cache hits.
misses: u64Number of cache misses.
Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for StatCache<K, V>
impl<K, V> RefUnwindSafe for StatCache<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for StatCache<K, V>
impl<K, V> Sync for StatCache<K, V>
impl<K, V> Unpin for StatCache<K, V>
impl<K, V> UnsafeUnpin for StatCache<K, V>
impl<K, V> UnwindSafe for StatCache<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