pub struct MappedMutexGuard<'a, T: ?Sized> { /* private fields */ }
Available on crate feature sync only.
Expand description

A handle to a held Mutex that has had a function applied to it via MutexGuard::map.

This can be used to hold a subfield of the protected data.

Implementations

Makes a new MappedMutexGuard for a component of the locked data.

This operation cannot fail as the MappedMutexGuard passed in already locked the mutex.

This is an associated function that needs to be used as MappedMutexGuard::map(...). A method would interfere with methods of the same name on the contents of the locked data.

Attempts to make a new MappedMutexGuard for a component of the locked data. The original guard is returned if the closure returns None.

This operation cannot fail as the MappedMutexGuard passed in already locked the mutex.

This is an associated function that needs to be used as MappedMutexGuard::try_map(...). A method would interfere with methods of the same name on the contents of the locked data.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more