Struct cachedb::EntryWriteGuard
source · Expand description
Guard for the write lock. Puts unused entries into the LRU list.
Implementations§
source§impl<'a, K, V, const N: usize> EntryWriteGuard<'a, K, V, N>where
K: KeyTraits,
impl<'a, K, V, const N: usize> EntryWriteGuard<'a, K, V, N>where
K: KeyTraits,
sourcepub fn expire(&mut self)
pub fn expire(&mut self)
Mark the entry for expiration. When dropped it will be put in front of the LRU list and by that evicted soon. Use with care, when many entries become pushed to the front, they eventually bubble up again.
sourcepub fn downgrade(self) -> EntryReadGuard<'a, K, V, N>
pub fn downgrade(self) -> EntryReadGuard<'a, K, V, N>
Downgrade a write lock to a read lock without releasing it.