Struct grafix_toolbox::uses::Async::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));
Trait Implementations
impl<T> Debug for MutexGuardArc<T> where
T: Debug + ?Sized,
impl<T> Debug for MutexGuardArc<T> where
T: Debug + ?Sized, impl<T> Deref for MutexGuardArc<T> where
T: ?Sized,
impl<T> Deref for MutexGuardArc<T> where
T: ?Sized, impl<T> DerefMut for MutexGuardArc<T> where
T: ?Sized,
impl<T> DerefMut for MutexGuardArc<T> where
T: ?Sized, impl<T> Display for MutexGuardArc<T> where
T: Display + ?Sized,
impl<T> Display for MutexGuardArc<T> where
T: Display + ?Sized, impl<T> Drop for MutexGuardArc<T> where
T: ?Sized,
impl<T> Drop for MutexGuardArc<T> where
T: ?Sized, impl<T> Send for MutexGuardArc<T> where
T: Send + ?Sized, impl<T> Sync for MutexGuardArc<T> where
T: Sync + ?Sized, Auto Trait Implementations
impl<T> !RefUnwindSafe for MutexGuardArc<T>impl<T: ?Sized> Unpin for MutexGuardArc<T>impl<T> !UnwindSafe for MutexGuardArc<T>Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = TShould always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> boolChecks if self is actually part of its subset T (and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SSUse with care! Same as self.to_subset but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SPThe inclusion map: converts self to the equivalent element of its superset.
pub fn vzip(self) -> V