Struct o::sync::MutexGuard 1.0.0
[−]
[src]
#[must_use]pub struct MutexGuard<'a, T> where
T: 'a + ?Sized, { /* fields omitted */ }
An RAII implementation of a "scoped lock" of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
The data protected by the mutex can be accessed through this guard via its
Deref
and DerefMut
implementations.
This structure is created by the lock
and try_lock
methods on
Mutex
.
Trait Implementations
impl<'a, T> Sync for MutexGuard<'a, T> where
T: Sync + ?Sized,
1.19.0[src]
T: Sync + ?Sized,
impl<'a, T> Debug for MutexGuard<'a, T> where
T: Debug + ?Sized,
1.16.0[src]
T: Debug + ?Sized,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl<'mutex, T> DerefMut for MutexGuard<'mutex, T> where
T: ?Sized,
[src]
T: ?Sized,
ⓘImportant traits for &'a mut Wfn deref_mut(&mut self) -> &mut T
[src]
ⓘImportant traits for &'a mut W
Mutably dereferences the value.
impl<'mutex, T> Deref for MutexGuard<'mutex, T> where
T: ?Sized,
[src]
T: ?Sized,
type Target = T
The resulting type after dereferencing.
ⓘImportant traits for &'a mut Wfn deref(&self) -> &T
[src]
ⓘImportant traits for &'a mut W
Dereferences the value.
impl<'a, T> Display for MutexGuard<'a, T> where
T: Display + ?Sized,
1.20.0[src]
T: Display + ?Sized,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl<'a, T> Drop for MutexGuard<'a, T> where
T: ?Sized,
[src]
T: ?Sized,
impl<'a, T> !Send for MutexGuard<'a, T> where
T: ?Sized,
[src]
T: ?Sized,