Struct cachedb::EntryWriteGuard
source · [−]Expand description
Guard for the write lock. Puts unused entries into the LRU list.
Implementations
sourceimpl<'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
sourceimpl<K, V, const N: usize> Deref for EntryWriteGuard<'_, K, V, N> where
K: KeyTraits,
impl<K, V, const N: usize> Deref for EntryWriteGuard<'_, K, V, N> where
K: KeyTraits,
sourceimpl<K, V, const N: usize> DerefMut for EntryWriteGuard<'_, K, V, N> where
K: KeyTraits,
impl<K, V, const N: usize> DerefMut for EntryWriteGuard<'_, K, V, N> where
K: KeyTraits,
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more