pub struct EntryWriteGuard<'a, K, V, const N: usize>where
K: KeyTraits,{ /* private fields */ }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.
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V, const N: usize> Freeze for EntryWriteGuard<'a, K, V, N>
impl<'a, K, V, const N: usize> !RefUnwindSafe for EntryWriteGuard<'a, K, V, N>
impl<'a, K, V, const N: usize> !Send for EntryWriteGuard<'a, K, V, N>
impl<'a, K, V, const N: usize> !Sync for EntryWriteGuard<'a, K, V, N>
impl<'a, K, V, const N: usize> Unpin for EntryWriteGuard<'a, K, V, N>
impl<'a, K, V, const N: usize> !UnwindSafe for EntryWriteGuard<'a, K, V, N>
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