pub enum GetOrSetEntry {
Occupied(IncomingValue),
Vacant(Vacancy),
}Expand description
The get-or-set operation asynchronously returns one of two cases
enumerated by get-or-set-entry: in the occupied case, the given key
already has a value present in the cache; in the vacant case, there
was no value and the caller should write a value into the returned
vacancy. This operation allows multiple concurrent get-or-set
invocations to rendezvous such that only one invocation receives the
vacant result while all other invocations wait until the vacancy is
filled before receiving an occupied result. Implementations are not
required to implement this rendezvous or to rendezvous in all possible
cases.
Variants§
Occupied(IncomingValue)
Vacant(Vacancy)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GetOrSetEntry
impl RefUnwindSafe for GetOrSetEntry
impl Send for GetOrSetEntry
impl Sync for GetOrSetEntry
impl Unpin for GetOrSetEntry
impl UnsafeUnpin for GetOrSetEntry
impl UnwindSafe for GetOrSetEntry
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