EntryResult

Enum EntryResult 

Source
pub enum EntryResult<'a, Key, Val, We, B, L, T> {
    Retained(T),
    Removed(Key, Val),
    Replaced(PlaceholderGuard<'a, Key, Val, We, B, L>, Val),
    Vacant(PlaceholderGuard<'a, Key, Val, We, B, L>),
    Timeout,
}
Expand description

Result of an entry or entry_async operation.

Variants§

§

Retained(T)

The key existed and the callback returned EntryAction::Retain. Contains the value T returned by the callback.

§

Removed(Key, Val)

The key existed and the callback returned EntryAction::Remove. Contains the removed key and value.

§

Replaced(PlaceholderGuard<'a, Key, Val, We, B, L>, Val)

The key existed and the callback returned EntryAction::ReplaceWithGuard. Contains a PlaceholderGuard for re-insertion and the old value.

§

Vacant(PlaceholderGuard<'a, Key, Val, We, B, L>)

The key was absent. Contains a PlaceholderGuard for inserting a new value.

§

Timeout

Timed out waiting for another loader’s placeholder.

Only returned by Cache::entry, which accepts a timeout parameter. For the async variant, use an external timeout mechanism (e.g. tokio::time::timeout).

Trait Implementations§

Source§

impl<'a, Key: Debug, Val: Debug, We: Debug, B: Debug, L: Debug, T: Debug> Debug for EntryResult<'a, Key, Val, We, B, L, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, Key, Val, We, B, L, T> Freeze for EntryResult<'a, Key, Val, We, B, L, T>
where T: Freeze, Key: Freeze, Val: Freeze,

§

impl<'a, Key, Val, We, B, L, T> RefUnwindSafe for EntryResult<'a, Key, Val, We, B, L, T>

§

impl<'a, Key, Val, We, B, L, T> Send for EntryResult<'a, Key, Val, We, B, L, T>
where T: Send, Key: Send + Sync, Val: Send + Sync, L: Sync + Send, B: Send + Sync, We: Send + Sync,

§

impl<'a, Key, Val, We, B, L, T> Sync for EntryResult<'a, Key, Val, We, B, L, T>
where T: Sync, Key: Sync + Send, Val: Sync + Send, L: Sync + Send, B: Send + Sync, We: Send + Sync,

§

impl<'a, Key, Val, We, B, L, T> Unpin for EntryResult<'a, Key, Val, We, B, L, T>
where T: Unpin, Key: Unpin, Val: Unpin,

§

impl<'a, Key, Val, We, B, L, T> UnwindSafe for EntryResult<'a, Key, Val, We, B, L, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.