Struct light_cache::policy::lru::LruPolicy
source · pub struct LruPolicy<K, V> { /* private fields */ }Expand description
An LRU policy with optional expiry.
Implementations§
Trait Implementations§
source§impl<K, V> Policy<K, V> for LruPolicy<K, V>
impl<K, V> Policy<K, V> for LruPolicy<K, V>
§type Inner = LruPolicyInner<K>
type Inner = LruPolicyInner<K>
The inner type of this policy, likely behind a lock
source§fn lock_inner(&self) -> MutexGuard<'_, Self::Inner>
fn lock_inner(&self) -> MutexGuard<'_, Self::Inner>
Panics Read more
fn get<S: BuildHasher>( &self, key: &K, cache: &LightCache<K, V, S, Self>, ) -> Option<V>
fn insert<S: BuildHasher>( &self, key: K, value: V, cache: &LightCache<K, V, S, Self>, ) -> Option<V>
fn remove<S: BuildHasher>( &self, key: &K, cache: &LightCache<K, V, S, Self>, ) -> Option<V>
fn lock_and_prune<S: BuildHasher>( &self, cache: &LightCache<K, V, S, Self>, ) -> MutexGuard<'_, Self::Inner>
Auto Trait Implementations§
impl<K, V> !Freeze for LruPolicy<K, V>
impl<K, V> !RefUnwindSafe for LruPolicy<K, V>
impl<K, V> Send for LruPolicy<K, V>
impl<K, V> Sync for LruPolicy<K, V>
impl<K, V> Unpin for LruPolicy<K, V>
impl<K, V> UnwindSafe for LruPolicy<K, V>where
V: UnwindSafe,
K: 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