EntryOrPlaceholder

Enum EntryOrPlaceholder 

Source
pub enum EntryOrPlaceholder<Key, Val, Plh, T> {
    Kept(T),
    Removed(Key, Val),
    Replaced(Plh, Val),
    ExistingPlaceholder(Plh),
    NewPlaceholder(Plh),
}
Expand description

Result of an entry-or-placeholder operation at the shard level.

Variants§

§

Kept(T)

Callback returned Retain(T) — entry is still in the cache.

§

Removed(Key, Val)

Callback returned Remove — entry was removed.

§

Replaced(Plh, Val)

Callback returned ReplaceWithGuard — entry was replaced with a placeholder. The old value is returned so it can be dropped outside the lock.

§

ExistingPlaceholder(Plh)

Found an existing placeholder (another loader is working on this key).

§

NewPlaceholder(Plh)

No entry existed, a new placeholder was created.

Auto Trait Implementations§

§

impl<Key, Val, Plh, T> Freeze for EntryOrPlaceholder<Key, Val, Plh, T>
where T: Freeze, Key: Freeze, Val: Freeze, Plh: Freeze,

§

impl<Key, Val, Plh, T> RefUnwindSafe for EntryOrPlaceholder<Key, Val, Plh, T>

§

impl<Key, Val, Plh, T> Send for EntryOrPlaceholder<Key, Val, Plh, T>
where T: Send, Key: Send, Val: Send, Plh: Send,

§

impl<Key, Val, Plh, T> Sync for EntryOrPlaceholder<Key, Val, Plh, T>
where T: Sync, Key: Sync, Val: Sync, Plh: Sync,

§

impl<Key, Val, Plh, T> Unpin for EntryOrPlaceholder<Key, Val, Plh, T>
where T: Unpin, Key: Unpin, Val: Unpin, Plh: Unpin,

§

impl<Key, Val, Plh, T> UnwindSafe for EntryOrPlaceholder<Key, Val, Plh, T>
where T: UnwindSafe, Key: UnwindSafe, Val: UnwindSafe, Plh: UnwindSafe,

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.