Struct OwnedMappedMutexGuard
pub struct OwnedMappedMutexGuard<T: ?Sized, U: ?Sized = T> { /* private fields */ }
sync only.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
impl<T: ?Sized, U: ?Sized> OwnedMappedMutexGuard<T, U>
pub fn map<S, F>(this: Self, 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.
pub fn try_map<S, F>( this: Self, f: F, ) -> Result<OwnedMappedMutexGuard<T, S>, Self>
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
impl<T: ?Sized, U: ?Sized + Debug> Debug for OwnedMappedMutexGuard<T, U>
impl<T: ?Sized, U: ?Sized> Deref for OwnedMappedMutexGuard<T, U>
impl<T: ?Sized, U: ?Sized> DerefMut for OwnedMappedMutexGuard<T, U>
impl<T: ?Sized, U: ?Sized + Display> Display for OwnedMappedMutexGuard<T, U>
impl<T: ?Sized, U: ?Sized> 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 = T> !RefUnwindSafe for OwnedMappedMutexGuard<T, U>
impl<T, U = T> !UnwindSafe for OwnedMappedMutexGuard<T, U>
impl<T, U> Freeze for OwnedMappedMutexGuard<T, U>
impl<T, U> Unpin for OwnedMappedMutexGuard<T, U>
impl<T, U> UnsafeUnpin for OwnedMappedMutexGuard<T, U>
Blanket Implementations
impl<T> BorrowMut<T> for Twhere T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> Instrument for T
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<P, T> Receiver for P
type Target = T
arbitrary_self_types)
impl<T> ToString for T
impl<T> WithSubscriber for T
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
MIT License
Copyright © Tokio Contributors
https://docs.rs/tokio/1.53.1/tokio/sync/struct.OwnedMappedMutexGuard.html