Struct tokio::sync::MutexGuard
source · [−]pub struct MutexGuard<'a, T: ?Sized> { /* private fields */ }
Expand description
A handle to a held Mutex
.
As long as you have this guard, you have exclusive access to the underlying
T
. The guard internally borrows the Mutex
, so the mutex will not be
dropped while a guard exists.
The lock is automatically released whenever the guard is dropped, at which
point lock
will succeed yet again.
Trait Implementations
sourceimpl<T: ?Sized + Debug> Debug for MutexGuard<'_, T>
impl<T: ?Sized + Debug> Debug for MutexGuard<'_, T>
sourceimpl<T: ?Sized> Deref for MutexGuard<'_, T>
impl<T: ?Sized> Deref for MutexGuard<'_, T>
sourceimpl<T: ?Sized> DerefMut for MutexGuard<'_, T>
impl<T: ?Sized> DerefMut for MutexGuard<'_, T>
sourceimpl<T: ?Sized + Display> Display for MutexGuard<'_, T>
impl<T: ?Sized + Display> Display for MutexGuard<'_, T>
sourceimpl<T: ?Sized> Drop for MutexGuard<'_, T>
impl<T: ?Sized> Drop for MutexGuard<'_, T>
impl<T> Sync for MutexGuard<'_, T> where
T: ?Sized + Send + Sync,
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for MutexGuard<'a, T>
impl<'a, T: ?Sized> Send for MutexGuard<'a, T> where
T: Send,
impl<'a, T: ?Sized> Unpin for MutexGuard<'a, T>
impl<'a, T> !UnwindSafe for MutexGuard<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more