pub struct LockDepMutex<T, L> { /* private fields */ }Expand description
A Mutex that dynamically enforces lock ordering at runtime using types for levels.
Implementations§
Source§impl<T, L: LockLevel> LockDepMutex<T, L>
impl<T, L: LockLevel> LockDepMutex<T, L>
pub const fn new(value: T) -> Self
pub fn lock(&self) -> LockDepGuard<'_, T>
Sourcepub fn get_mut(&mut self) -> &mut T
pub fn get_mut(&mut self) -> &mut T
Returns a mutable reference to the underlying data.
Since this call borrows the LockDepMutex mutably, no actual locking takes place – the
borrow checker statically ensures no other threads have access to the LockDepMutex.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the LockDepMutex, returning the underlying data.
Trait Implementations§
Source§impl<T: Debug, L> Debug for LockDepMutex<T, L>
impl<T: Debug, L> Debug for LockDepMutex<T, L>
Source§impl<T, L: LockLevel> From<T> for LockDepMutex<T, L>
impl<T, L: LockLevel> From<T> for LockDepMutex<T, L>
Auto Trait Implementations§
impl<T, L> !Freeze for LockDepMutex<T, L>
impl<T, L> !RefUnwindSafe for LockDepMutex<T, L>
impl<T, L> Send for LockDepMutex<T, L>
impl<T, L> Sync for LockDepMutex<T, L>
impl<T, L> Unpin for LockDepMutex<T, L>
impl<T, L> UnsafeUnpin for LockDepMutex<T, L>where
T: UnsafeUnpin,
impl<T, L> UnwindSafe for LockDepMutex<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