Struct rbatis_core::runtime::sync::MutexGuardArc [−]
pub struct MutexGuardArc<T>(_)
where
T: ?Sized;Expand description
An owned guard that releases the mutex when dropped.
Implementations
impl<T> MutexGuardArc<T> where
T: ?Sized,
impl<T> MutexGuardArc<T> where
T: ?Sized,
pub fn source(guard: &MutexGuardArc<T>) -> &Arc<Mutex<T>>
pub fn source(guard: &MutexGuardArc<T>) -> &Arc<Mutex<T>>
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));