pub struct TryMutex<T> { /* private fields */ }
Expand description
A mutual exclusion primitive that does not support blocking or poisoning. This results in a simpler and faster implementation.
Implementations
sourceimpl<T> TryMutex<T>
impl<T> TryMutex<T>
sourcepub fn try_lock(&self) -> Option<TryMutexGuard<'_, T>>
pub fn try_lock(&self) -> Option<TryMutexGuard<'_, T>>
Attemps to acquire a lock on this mutex. If this mutex is currently
locked, None
is returned. Otherwise a RAII guard is returned. The lock
will be unlocked when the guard is dropped.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes this mutex, returning the underlying data.
Trait Implementations
impl<T> RefUnwindSafe for TryMutex<T>
impl<T: Send> Send for TryMutex<T>
impl<T: Send> Sync for TryMutex<T>
impl<T> UnwindSafe for TryMutex<T>
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more