pub enum CacheOut<V> {
None,
Present(V),
NotInserted(V),
}
Expand description
Output of cache operations.
CacheOut::None
and CacheOut::Present
reflects the HashMap
API.
CacheOut::NotInserted
is added to indicate the content to be cached
does not meet the requirements (e.g. it’s too big)
Variants§
None
No value.
Returned when no item occupies the input key.
Present(V)
Successful cache lookup.
Returned when an item occupies the input key.
NotInserted(V)
Error when value failed to get inserted. See CacheOut
.
Implementations§
source§impl<V> CacheOut<V>
impl<V> CacheOut<V>
sourcepub fn into_option(self) -> Option<V>
pub fn into_option(self) -> Option<V>
Maps self to an Option
.
Variants with a value are turned to Some
and CacheOut::None
to None
.
Trait Implementations§
impl<V: Eq> Eq for CacheOut<V>
impl<V> StructuralPartialEq for CacheOut<V>
Auto Trait Implementations§
impl<V> Freeze for CacheOut<V>where
V: Freeze,
impl<V> RefUnwindSafe for CacheOut<V>where
V: RefUnwindSafe,
impl<V> Send for CacheOut<V>where
V: Send,
impl<V> Sync for CacheOut<V>where
V: Sync,
impl<V> Unpin for CacheOut<V>where
V: Unpin,
impl<V> UnwindSafe for CacheOut<V>where
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more