Trait foyer_memory::CacheEventListener

source ·
pub trait CacheEventListener<K, V>: Send + Sync + 'static
where K: Key, V: Value,
{ // Required method fn on_release( &self, key: Arc<K>, value: Arc<V>, context: CacheContext, weight: usize ); }

Required Methods§

source

fn on_release( &self, key: Arc<K>, value: Arc<V>, context: CacheContext, weight: usize )

The function is called when an entry is released by the cache and all external users.

The arguments includes the key and value with ownership.

Implementors§

source§

impl<K, V> CacheEventListener<K, V> for DefaultCacheEventListener<K, V>
where K: Key, V: Value,