pub struct Mutex<T> { /* private fields */ }Expand description
A wrapper around std::sync::Mutex.
Implementations§
Source§impl<T> Mutex<T>
impl<T> Mutex<T>
Sourcepub fn lock(&self) -> Option<MutexGuard<'_, T>>
pub fn lock(&self) -> Option<MutexGuard<'_, T>>
Acquires the mutex, blocking the current thread until it is able to do so.
This will return None in the case the mutex is poisoned.
Sourcepub fn into_inner(self) -> LockResult<T>
pub fn into_inner(self) -> LockResult<T>
Consumes the mutex, returning the underlying data.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Mutex<T>
impl<T> RefUnwindSafe for Mutex<T>where
Mutex<T>: RefUnwindSafe,
impl<T> Send for Mutex<T>
impl<T> Sync for Mutex<T>
impl<T> Unpin for Mutex<T>
impl<T> UnsafeUnpin for Mutex<T>where
Mutex<T>: UnsafeUnpin,
impl<T> UnwindSafe for Mutex<T>where
Mutex<T>: UnwindSafe,
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