Struct grafix_toolbox::uses::Async::sync::MutexGuard [−]
pub struct MutexGuard<'a, T>(_)
where
T: ?Sized;
Expand description
A guard that releases the mutex when dropped.
Implementations
impl<'a, T> MutexGuard<'a, T> where
T: ?Sized,
impl<'a, T> MutexGuard<'a, T> where
T: ?Sized, pub fn source(guard: &MutexGuard<'a, T>) -> &'a Mutex<T>
pub fn source(guard: &MutexGuard<'a, T>) -> &'a Mutex<T>Returns a reference to the mutex a guard came from.
Examples
use async_lock::{Mutex, MutexGuard}; let mutex = Mutex::new(10i32); let guard = mutex.lock().await; dbg!(MutexGuard::source(&guard));
Trait Implementations
impl<'_, T> Debug for MutexGuard<'_, T> where
T: Debug + ?Sized,
impl<'_, T> Debug for MutexGuard<'_, T> where
T: Debug + ?Sized, impl<'_, T> Deref for MutexGuard<'_, T> where
T: ?Sized,
impl<'_, T> Deref for MutexGuard<'_, T> where
T: ?Sized, impl<'_, T> DerefMut for MutexGuard<'_, T> where
T: ?Sized,
impl<'_, T> DerefMut for MutexGuard<'_, T> where
T: ?Sized, impl<'_, T> Display for MutexGuard<'_, T> where
T: Display + ?Sized,
impl<'_, T> Display for MutexGuard<'_, T> where
T: Display + ?Sized, impl<'_, T> Drop for MutexGuard<'_, T> where
T: ?Sized,
impl<'_, T> Drop for MutexGuard<'_, T> where
T: ?Sized, impl<'_, T> Send for MutexGuard<'_, T> where
T: Send + ?Sized, impl<'_, T> Sync for MutexGuard<'_, T> where
T: Sync + ?Sized, Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for MutexGuard<'a, T>impl<'a, T: ?Sized> Unpin for MutexGuard<'a, T>impl<'a, T> !UnwindSafe for MutexGuard<'a, 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