Struct light_cache::policy::noop::NoopPolicy
source · pub struct NoopPolicy(/* private fields */);Expand description
A policy that does nothing
While this policy does nothing, we still need to give it a mutex so that it can satisfy the Policy trait It would not be good if a user accidently called prune on a noop policy and got a panic
Implementations§
source§impl NoopPolicy
impl NoopPolicy
Trait Implementations§
source§impl Debug for NoopPolicy
impl Debug for NoopPolicy
source§impl<K, V> Policy<K, V> for NoopPolicy
impl<K, V> Policy<K, V> for NoopPolicy
source§fn lock_inner(&self) -> MutexGuard<'_, ()>
fn lock_inner(&self) -> MutexGuard<'_, ()>
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>
source§impl<K, V> Prune<K, V, NoopPolicy> for ()
impl<K, V> Prune<K, V, NoopPolicy> for ()
source§fn prune<S: BuildHasher>(&mut self, _: &LightCache<K, V, S, NoopPolicy>)
fn prune<S: BuildHasher>(&mut self, _: &LightCache<K, V, S, NoopPolicy>)
Prune is typically be called before any operation on the cache
Auto Trait Implementations§
impl !Freeze for NoopPolicy
impl !RefUnwindSafe for NoopPolicy
impl Send for NoopPolicy
impl Sync for NoopPolicy
impl Unpin for NoopPolicy
impl UnwindSafe for NoopPolicy
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