pub struct MutexGuard<'a, L: Level, T: ?Sized + 'a> { /* private fields */ }
Expand description
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.
Implementations§
Source§impl<'a, L: Level, T: ?Sized + 'a> MutexGuard<'a, L, T>
impl<'a, L: Level, T: ?Sized + 'a> MutexGuard<'a, L, T>
Sourcepub fn token_split(&mut self) -> (&mut T, LockToken<'_, L>)
pub fn token_split(&mut self) -> (&mut T, LockToken<'_, L>)
Split the guard into two parts, the first a mutable reference to the held content
the second a LockToken
that can be used for further locking
Trait Implementations§
Auto Trait Implementations§
impl<'a, L, T> Freeze for MutexGuard<'a, L, T>where
T: ?Sized,
impl<'a, L, T> RefUnwindSafe for MutexGuard<'a, L, T>where
L: RefUnwindSafe,
T: ?Sized,
impl<'a, L, T> !Send for MutexGuard<'a, L, T>
impl<'a, L, T> Sync for MutexGuard<'a, L, T>
impl<'a, L, T> Unpin for MutexGuard<'a, L, T>where
T: ?Sized,
impl<'a, L, T> !UnwindSafe for MutexGuard<'a, L, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more