pub trait Lifecycle<K, V> {
// Provided methods
fn on_eviction(&mut self, _key: K, _value: V) { ... }
fn evaluate(&self, _key: &K, _value: &V) -> EntryStatus { ... }
}Provided Methods§
Sourcefn on_eviction(&mut self, _key: K, _value: V)
fn on_eviction(&mut self, _key: K, _value: V)
Called when an entry has been evicted from the cache. Receives ownership of the key and value so they can be forwarded or dropped.
Sourcefn evaluate(&self, _key: &K, _value: &V) -> EntryStatus
fn evaluate(&self, _key: &K, _value: &V) -> EntryStatus
Inspect an existing entry and decide whether it should remain in the
cache. Called as the sieve hand passes over entries during Cache::put.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".