pub struct MutexGuardArc<T: ?Sized>(/* private fields */);
Expand description
An owned guard that releases the mutex when dropped.
Implementations§
source§impl<T: ?Sized> MutexGuardArc<T>
impl<T: ?Sized> MutexGuardArc<T>
sourcepub fn source(guard: &Self) -> &Arc<Mutex<T>>where
T: Send,
pub fn source(guard: &Self) -> &Arc<Mutex<T>>where
T: Send,
Returns a reference to the mutex a guard came from.
§Examples
use async_lock::{Mutex, MutexGuardArc};
use std::sync::Arc;
let mutex = Arc::new(Mutex::new(10i32));
let guard = mutex.lock_arc().await;
dbg!(MutexGuardArc::source(&guard));
Trait Implementations§
source§impl<T: ?Sized> Deref for MutexGuardArc<T>
impl<T: ?Sized> Deref for MutexGuardArc<T>
source§impl<T: ?Sized> DerefMut for MutexGuardArc<T>
impl<T: ?Sized> DerefMut for MutexGuardArc<T>
source§impl<T: ?Sized> Drop for MutexGuardArc<T>
impl<T: ?Sized> Drop for MutexGuardArc<T>
impl<T: Send + ?Sized> Send for MutexGuardArc<T>
impl<T: Sync + ?Sized> Sync for MutexGuardArc<T>
Auto Trait Implementations§
impl<T> Freeze for MutexGuardArc<T>where
T: ?Sized,
impl<T> !RefUnwindSafe for MutexGuardArc<T>
impl<T> Unpin for MutexGuardArc<T>where
T: ?Sized,
impl<T> !UnwindSafe for MutexGuardArc<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