pub struct MutexGuard<'a, T> { /* private fields */ }
Expand description

An RAII scoped lock of a Mutex. It automatically unlocks the mutex when dropped (falls out of scope).

You can access the data in the mutex through this guard’s Deref and DerefMut implementations.

The struct is not Send so you cannot await while holding it.

If a task panics while holding the struct, the underlying mutex becomes “poisoned” and subsequent calls to lock will panic.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

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.

Calls U::from(self).

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

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.