Enum generational_cache::cache::Eviction
source · pub enum Eviction<K, V> {
Block {
key: K,
value: V,
},
Value(V),
None,
}
Expand description
The outcome of an eviction from a cache.
Evictions occur in cache implementations on insert operations in a maxed out cache. This happens to make space for the just inserted key/value pair.
Variants§
Block
Block eviction with evicted key/value pair on a key/value insertion with an unique key.
Value(V)
Value eviction on insertion with a key already existing in the cache.
None
No eviction when the cache is not maxed out.
Trait Implementations§
source§impl<K: PartialEq, V: PartialEq> PartialEq for Eviction<K, V>
impl<K: PartialEq, V: PartialEq> PartialEq for Eviction<K, V>
impl<K: Eq, V: Eq> Eq for Eviction<K, V>
impl<K, V> StructuralEq for Eviction<K, V>
impl<K, V> StructuralPartialEq for Eviction<K, V>
Auto Trait Implementations§
impl<K, V> RefUnwindSafe for Eviction<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,
impl<K, V> Send for Eviction<K, V>where K: Send, V: Send,
impl<K, V> Sync for Eviction<K, V>where K: Sync, V: Sync,
impl<K, V> Unpin for Eviction<K, V>where K: Unpin, V: Unpin,
impl<K, V> UnwindSafe for Eviction<K, V>where K: UnwindSafe, V: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more