Enum dashmap::try_result::TryResult
source · [−]pub enum TryResult<R> {
Present(R),
Absent,
Locked,
}
Expand description
Represents the result of a non-blocking read from a DashMap.
Variants
Present(R)
The value was present in the map, and the lock for the shard was successfully obtained.
Absent
The shard wasn’t locked, and the value wasn’t present in the map.
Locked
The shard was locked.
Implementations
sourceimpl<R> TryResult<R>
impl<R> TryResult<R>
sourcepub fn is_present(&self) -> bool
pub fn is_present(&self) -> bool
Returns true
if the value was present in the map, and the lock for the shard was successfully obtained.
sourcepub fn is_absent(&self) -> bool
pub fn is_absent(&self) -> bool
Returns true
if the shard wasn’t locked, and the value wasn’t present in the map.
sourcepub fn try_unwrap(self) -> Option<R>
pub fn try_unwrap(self) -> Option<R>
Trait Implementations
Auto Trait Implementations
impl<R> RefUnwindSafe for TryResult<R>where
R: RefUnwindSafe,
impl<R> Send for TryResult<R>where
R: Send,
impl<R> Sync for TryResult<R>where
R: Sync,
impl<R> Unpin for TryResult<R>where
R: Unpin,
impl<R> UnwindSafe for TryResult<R>where
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more