Struct async_std::sync::MutexGuardArc
source · pub struct MutexGuardArc<T>(/* private fields */)
where
T: ?Sized;
Expand description
An owned guard that releases the mutex when dropped.
Implementations§
source§impl<T> MutexGuardArc<T>where
T: ?Sized,
impl<T> MutexGuardArc<T>where
T: ?Sized,
sourcepub fn source(guard: &MutexGuardArc<T>) -> &Arc<Mutex<T>>where
T: Send,
pub fn source(guard: &MutexGuardArc<T>) -> &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> Debug for MutexGuardArc<T>
impl<T> Debug for MutexGuardArc<T>
source§impl<T> Deref for MutexGuardArc<T>where
T: ?Sized,
impl<T> Deref for MutexGuardArc<T>where
T: ?Sized,
source§impl<T> DerefMut for MutexGuardArc<T>where
T: ?Sized,
impl<T> DerefMut for MutexGuardArc<T>where
T: ?Sized,
source§impl<T> Display for MutexGuardArc<T>
impl<T> Display for MutexGuardArc<T>
source§impl<T> Drop for MutexGuardArc<T>where
T: ?Sized,
impl<T> Drop for MutexGuardArc<T>where
T: ?Sized,
impl<T> Send for MutexGuardArc<T>
impl<T> Sync for MutexGuardArc<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for MutexGuardArc<T>
impl<T: ?Sized> Unpin for MutexGuardArc<T>
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