Struct light_cache::policy::ttl::TtlPolicy
source · pub struct TtlPolicy<K, V> { /* private fields */ }Expand description
A simple time-to-live policy that removes only expired keys when the ttl is exceeded
Implementations§
Trait Implementations§
source§impl<K, V> Policy<K, V> for TtlPolicy<K, V>
impl<K, V> Policy<K, V> for TtlPolicy<K, V>
§type Inner = TtlPolicyInner<K>
type Inner = TtlPolicyInner<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>
source§fn prune<S: BuildHasher>(&self, cache: &LightCache<K, V, S, Self>)
fn prune<S: BuildHasher>(&self, cache: &LightCache<K, V, S, Self>)
Warning: Read more
Auto Trait Implementations§
impl<K, V> Freeze for TtlPolicy<K, V>
impl<K, V> RefUnwindSafe for TtlPolicy<K, V>where
V: RefUnwindSafe,
impl<K, V> Send for TtlPolicy<K, V>
impl<K, V> Sync for TtlPolicy<K, V>
impl<K, V> Unpin for TtlPolicy<K, V>where
V: Unpin,
impl<K, V> UnwindSafe for TtlPolicy<K, V>where
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)