pub enum CompResult<K, V> {
StillNone(Arc<K>),
Unchanged(Entry<K, V>),
Inserted(Entry<K, V>),
ReplacedWith(Entry<K, V>),
Removed(Entry<K, V>),
}
Expand description
The result of the and_compute_with
and similar methods.
Variants§
StillNone(Arc<K>)
The entry did not exist and still does not exist.
Unchanged(Entry<K, V>)
The entry already existed and was not modified. The returned entry contains the existing value.
Inserted(Entry<K, V>)
The entry did not exist and was inserted. The returned entry contains the inserted value.
ReplacedWith(Entry<K, V>)
The entry already existed and its value was replaced with a new one. The returned entry contains the new value (not the replaced value).
Removed(Entry<K, V>)
The entry already existed and was removed. The returned entry contains the removed value.
Note: StillNone
is returned instead of Removed
if Op::Remove
was
requested but the entry did not exist.
Implementations§
source§impl<K, V> CompResult<K, V>
impl<K, V> CompResult<K, V>
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for CompResult<K, V>where
V: Freeze,
impl<K, V> RefUnwindSafe for CompResult<K, V>where
V: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, V> Send for CompResult<K, V>
impl<K, V> Sync for CompResult<K, V>
impl<K, V> Unpin for CompResult<K, V>where
V: Unpin,
impl<K, V> UnwindSafe for CompResult<K, V>where
K: RefUnwindSafe,
V: 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