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§
source§impl<V: PartialEq> PartialEq<CacheOut<V>> for CacheOut<V>
impl<V: PartialEq> PartialEq<CacheOut<V>> for CacheOut<V>
impl<V: Eq> Eq for CacheOut<V>
impl<V> StructuralEq for CacheOut<V>
impl<V> StructuralPartialEq for CacheOut<V>
Auto Trait Implementations§
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more