Struct OwnedMappedMutexGuard

struct OwnedMappedMutexGuard<T: ?Sized, U: ?Sized = T> { ... }

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>

fn map<S, F>(this: Self, f: F) -> OwnedMappedMutexGuard<T, S>
where
    F: FnOnce(&mut U) -> &mut 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.

fn try_map<S, F>(this: Self, f: F) -> Result<OwnedMappedMutexGuard<T, S>, Self>
where
    F: FnOnce(&mut U) -> Option<&mut S>

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.

impl<P, T> Receiver for OwnedMappedMutexGuard<T, U>

impl<T> Any for OwnedMappedMutexGuard<T, U>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for OwnedMappedMutexGuard<T, U>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for OwnedMappedMutexGuard<T, U>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for OwnedMappedMutexGuard<T, U>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToString for OwnedMappedMutexGuard<T, U>

fn to_string(self: &Self) -> String

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> Into for OwnedMappedMutexGuard<T, U>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> Send for OwnedMappedMutexGuard<T, U>

impl<T, U> Sync for OwnedMappedMutexGuard<T, U>

impl<T, U> TryFrom for OwnedMappedMutexGuard<T, U>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for OwnedMappedMutexGuard<T, U>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<T, U> Unpin for OwnedMappedMutexGuard<T, U>

impl<T, U> UnsafeUnpin for OwnedMappedMutexGuard<T, U>

impl<T: ?Sized, U: ?Sized + fmt::Debug> Debug for OwnedMappedMutexGuard<T, U>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<T: ?Sized, U: ?Sized + fmt::Display> Display for OwnedMappedMutexGuard<T, U>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<T: ?Sized, U: ?Sized> Deref for OwnedMappedMutexGuard<T, U>

fn deref(self: &Self) -> &<Self as >::Target

impl<T: ?Sized, U: ?Sized> DerefMut for OwnedMappedMutexGuard<T, U>

fn deref_mut(self: &mut Self) -> &mut <Self as >::Target

impl<T: ?Sized, U: ?Sized> Drop for OwnedMappedMutexGuard<T, U>

fn drop(self: &mut Self)