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: K, value: V, context: CacheContext, charges: usize ); }

Required Methods§

source

fn on_release(&self, key: K, value: V, context: CacheContext, charges: 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,