pub struct MutexGuard<'a, T> { /* private fields */ }
Expand description
An RAII guard that releases the mutex when dropped
Implementations§
Source§impl<'a, T> MutexGuard<'a, T>
impl<'a, T> MutexGuard<'a, T>
Sourcepub fn unlock(self)
pub fn unlock(self)
Immediately drops the guard, and consequently unlocks the mutex.
This function is equivalent to calling drop
on the guard but is more self-documenting.
Sourcepub async fn unlock_fair(self)
pub async fn unlock_fair(self)
Release the lock and immediately yield control back to the async runtime
This essentially just calls Self::unlock then yield_now()
Trait Implementations§
Source§impl<T> Deref for MutexGuard<'_, T>
impl<T> Deref for MutexGuard<'_, T>
Source§impl<T> DerefMut for MutexGuard<'_, T>
impl<T> DerefMut for MutexGuard<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for MutexGuard<'a, T>
impl<'a, T> !RefUnwindSafe for MutexGuard<'a, T>
impl<'a, T> !Send for MutexGuard<'a, T>
impl<'a, T> !Sync for MutexGuard<'a, T>
impl<'a, T> Unpin for MutexGuard<'a, T>
impl<'a, T> !UnwindSafe for MutexGuard<'a, 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