Trait light_cache::policy::Prune

source ·
pub trait Prune<K, V, P> {
    // Required method
    fn prune<S: BuildHasher>(&mut self, cache: &LightCache<K, V, S, P>);
}
Expand description

Prune should control how entries are expired (not nescessarily evicted) from the cache

Required Methods§

source

fn prune<S: BuildHasher>(&mut self, cache: &LightCache<K, V, S, P>)

Prune is typically be called before any operation on the cache

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<K, V> Prune<K, V, NoopPolicy> for ()

source§

fn prune<S: BuildHasher>(&mut self, _: &LightCache<K, V, S, NoopPolicy>)

Implementors§

source§

impl<K, V> Prune<K, V, LruPolicy<K, V>> for LruPolicyInner<K>
where K: Copy + Eq + Hash, V: Clone + Sync,

source§

impl<K, V> Prune<K, V, TtlPolicy<K, V>> for TtlPolicyInner<K>
where K: Copy + Eq + Hash, V: Clone + Sync,