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§
Source§impl<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> Freeze for TryResult<R>where
R: Freeze,
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§
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
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.