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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more