pub struct OwnedMutexGuard<T> { /* private fields */ }Expand description
An owned guard that releases the mutex when dropped.
Implementations§
Source§impl<T> OwnedMutexGuard<T>
impl<T> OwnedMutexGuard<T>
Sourcepub async fn lock<Caps>(
mutex: Arc<Mutex<T>>,
cx: &Cx<Caps>,
) -> Result<Self, LockError>
pub async fn lock<Caps>( mutex: Arc<Mutex<T>>, cx: &Cx<Caps>, ) -> Result<Self, LockError>
Acquires the mutex asynchronously (owned).
Sourcepub fn try_lock(mutex: Arc<Mutex<T>>) -> Result<Self, TryLockError>
pub fn try_lock(mutex: Arc<Mutex<T>>) -> Result<Self, TryLockError>
Tries to acquire the mutex without waiting.
Trait Implementations§
Source§impl<T> Deref for OwnedMutexGuard<T>
impl<T> Deref for OwnedMutexGuard<T>
Source§impl<T> DerefMut for OwnedMutexGuard<T>
impl<T> DerefMut for OwnedMutexGuard<T>
Source§impl<T> Drop for OwnedMutexGuard<T>
impl<T> Drop for OwnedMutexGuard<T>
impl<T: Send> Send for OwnedMutexGuard<T>
impl<T: Sync> Sync for OwnedMutexGuard<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for OwnedMutexGuard<T>
impl<T> !UnwindSafe for OwnedMutexGuard<T>
impl<T> Freeze for OwnedMutexGuard<T>
impl<T> Unpin for OwnedMutexGuard<T>
impl<T> UnsafeUnpin for OwnedMutexGuard<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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more