A mutex-guard.
struct MutexGuard<'a, T>
where T: 'a,
{
/* private fields */
}| Receiver | Name | Description |
|---|---|---|
&self | as_lock_guard | Returns a reference to the underlying lock-guard. |
&self | as_mutex | Returns a reference to the underlying mutex. |
self | into_lock_guard | Turns the mutex-guard into the underlying lock-guard. |
self | unlock | Unlocks the mutex and returns a reference to it. |
| Name | Description |
|---|---|
| Debug | Objects that can be formatted in a "debug" form. |
| Deref | Objects that implement the immutable dereference operator. |
| DerefMut | Objects that implement the mutable dereference operator. |
| Send | Objects whose ownership can be moved from one thread to another. |
| Sync | Objects that allow immutable access from threads other than their owning thread. |
This guard automatically unlocks the mutex when it goes out of scope.