pub struct OwnedMappedMutexGuard<T, U = T>{ /* private fields */ }
Expand description
A owned handle to a held Mutex
that has had a function applied to it via
OwnedMutexGuard::map
.
This can be used to hold a subfield of the protected data.
Implementations§
Source§impl<T, U> OwnedMappedMutexGuard<T, U>
impl<T, U> OwnedMappedMutexGuard<T, U>
Sourcepub fn map<S, F>(
this: OwnedMappedMutexGuard<T, U>,
f: F,
) -> OwnedMappedMutexGuard<T, S>
pub fn map<S, F>( this: OwnedMappedMutexGuard<T, U>, f: F, ) -> OwnedMappedMutexGuard<T, S>
Makes a new OwnedMappedMutexGuard
for a component of the locked data.
This operation cannot fail as the OwnedMappedMutexGuard
passed in already locked the mutex.
This is an associated function that needs to be used as OwnedMappedMutexGuard::map(...)
. A method
would interfere with methods of the same name on the contents of the locked data.
Sourcepub fn try_map<S, F>(
this: OwnedMappedMutexGuard<T, U>,
f: F,
) -> Result<OwnedMappedMutexGuard<T, S>, OwnedMappedMutexGuard<T, U>>
pub fn try_map<S, F>( this: OwnedMappedMutexGuard<T, U>, f: F, ) -> Result<OwnedMappedMutexGuard<T, S>, OwnedMappedMutexGuard<T, U>>
Attempts to make a new OwnedMappedMutexGuard
for a component of the locked data. The
original guard is returned if the closure returns None
.
This operation cannot fail as the OwnedMutexGuard
passed in already locked the mutex.
This is an associated function that needs to be used as OwnedMutexGuard::try_map(...)
. A
method would interfere with methods of the same name on the contents of the locked data.
Trait Implementations§
Source§impl<T, U> Debug for OwnedMappedMutexGuard<T, U>
impl<T, U> Debug for OwnedMappedMutexGuard<T, U>
Source§impl<T, U> Deref for OwnedMappedMutexGuard<T, U>
impl<T, U> Deref for OwnedMappedMutexGuard<T, U>
Source§impl<T, U> DerefMut for OwnedMappedMutexGuard<T, U>
impl<T, U> DerefMut for OwnedMappedMutexGuard<T, U>
Source§impl<T, U> Display for OwnedMappedMutexGuard<T, U>
impl<T, U> Display for OwnedMappedMutexGuard<T, U>
Source§impl<T, U> Drop for OwnedMappedMutexGuard<T, U>
impl<T, U> Drop for OwnedMappedMutexGuard<T, U>
impl<T, U> Send for OwnedMappedMutexGuard<T, U>
impl<T, U> Sync for OwnedMappedMutexGuard<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for OwnedMappedMutexGuard<T, U>
impl<T, U = T> !RefUnwindSafe for OwnedMappedMutexGuard<T, U>
impl<T, U> Unpin for OwnedMappedMutexGuard<T, U>
impl<T, U = T> !UnwindSafe for OwnedMappedMutexGuard<T, U>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.