pub struct Mutex<T, L> { /* private fields */ }Expand description
Similar to std::sync::Mutex<T> but built on top of LockingMechanism.
Implementations§
Source§impl<T, L> Mutex<T, L>where
L: LockingMechanism,
impl<T, L> Mutex<T, L>where
L: LockingMechanism,
Sourcepub const fn new(value: T, lock: L) -> Self
pub const fn new(value: T, lock: L) -> Self
Construct a new Mutex with the given locking mechanism.
Sourcepub fn lock(&self) -> MutexGuard<'_, T, L>
pub fn lock(&self) -> MutexGuard<'_, T, L>
Lock this Mutex.
Trait Implementations§
impl<T, L> Send for Mutex<T, L>
impl<T, L> Sync for Mutex<T, L>
Auto Trait Implementations§
impl<T, L> !Freeze for Mutex<T, L>
impl<T, L> !RefUnwindSafe for Mutex<T, L>
impl<T, L> Unpin for Mutex<T, L>
impl<T, L> UnwindSafe for Mutex<T, L>where
L: UnwindSafe,
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