pub enum CacheResult<K, V> {
Stored {
key: K,
replaced: Option<V>,
evicted: Option<CacheEntry<K, V>>,
},
Hit {
key: K,
value: V,
},
Miss {
key: K,
},
Removed {
key: K,
value: V,
},
Absent {
key: K,
},
}Expand description
Factual result of one Cache command.
Variants§
Stored
The value is stored as most recently used.
Fields
§
key: KStored key.
§
evicted: Option<CacheEntry<K, V>>Least-recently-used entry evicted for capacity, if any.
Hit
Lookup found and refreshed one value.
Miss
Lookup found no value.
Fields
§
key: KRemoved
Explicit removal returned ownership.
Absent
Explicit removal found no value.
Fields
§
key: KTrait Implementations§
Source§impl<K: Clone, V: Clone> Clone for CacheResult<K, V>
impl<K: Clone, V: Clone> Clone for CacheResult<K, V>
Source§fn clone(&self) -> CacheResult<K, V>
fn clone(&self) -> CacheResult<K, V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<K: Eq, V: Eq> Eq for CacheResult<K, V>
impl<K, V> StructuralPartialEq for CacheResult<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for CacheResult<K, V>
impl<K, V> RefUnwindSafe for CacheResult<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for CacheResult<K, V>
impl<K, V> Sync for CacheResult<K, V>
impl<K, V> Unpin for CacheResult<K, V>
impl<K, V> UnsafeUnpin for CacheResult<K, V>where
K: UnsafeUnpin,
V: UnsafeUnpin,
impl<K, V> UnwindSafe for CacheResult<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