Trait foyer_memory::CacheEventListener
source · pub trait CacheEventListener<K, V>: Send + Sync + 'static{
// Required method
fn on_release(
&self,
key: Arc<K>,
value: Arc<V>,
context: CacheContext,
weight: usize
);
}Required Methods§
sourcefn on_release(
&self,
key: Arc<K>,
value: Arc<V>,
context: CacheContext,
weight: usize
)
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.