Trait stretto::CacheCallback
source · [−]pub trait CacheCallback<V: Send + Sync>: Send + Sync + 'static {
fn on_exit(&self, val: Option<V>);
fn on_evict(&self, item: Item<V>) { ... }
fn on_reject(&self, item: Item<V>) { ... }
}Expand description
CacheCallback is for customize some extra operations on values when related event happens.
Required methods
Provided methods
on_evict is called for every eviction and passes the hashed key, value, and cost to the function.