pub enum Cache<T> {
NotFound,
Found(T),
}
Expand description
When dealing with caches, fetch values are the most common operation. This
enum represents the result of a fetch operation, and can be used to determine
if you’ve got a cache miss or not. It works a lot like the Option
enum, but
with a bit more context.
Variants§
NotFound
The value was not found in the cache; cache miss.
Found(T)
The value was found in the cache; cache hit.
Trait Implementations§
impl<T: Eq> Eq for Cache<T>
impl<T> StructuralPartialEq for Cache<T>
Auto Trait Implementations§
impl<T> Freeze for Cache<T>where
T: Freeze,
impl<T> RefUnwindSafe for Cache<T>where
T: RefUnwindSafe,
impl<T> Send for Cache<T>where
T: Send,
impl<T> Sync for Cache<T>where
T: Sync,
impl<T> Unpin for Cache<T>where
T: Unpin,
impl<T> UnwindSafe for Cache<T>where
T: 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