pub enum EntryAction<T> {
Retain(T),
Remove,
ReplaceWithGuard,
}Expand description
What to do with an existing entry after inspection/mutation.
Used with Cache::entry and
Cache::entry_async.
Variants§
Retain(T)
Retain the entry in the cache. The value may have been mutated in place before returning this variant.
Returns EntryResult::Retained(T).
Remove
Remove the entry from the cache.
Returns EntryResult::Removed(Key, Val).
ReplaceWithGuard
Remove the entry and get a PlaceholderGuard
for re-insertion. This is useful for “validate-or-recompute” patterns.
Auto Trait Implementations§
impl<T> Freeze for EntryAction<T>where
T: Freeze,
impl<T> RefUnwindSafe for EntryAction<T>where
T: RefUnwindSafe,
impl<T> Send for EntryAction<T>where
T: Send,
impl<T> Sync for EntryAction<T>where
T: Sync,
impl<T> Unpin for EntryAction<T>where
T: Unpin,
impl<T> UnwindSafe for EntryAction<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