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>
pub fn try_lock(&self) -> Option<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>
Source§impl<T, L: LockLevel> Inspect for &LockDepMutex<T, L>
impl<T, L: LockLevel> Inspect for &LockDepMutex<T, L>
Source§impl<T, L> MutexLike for LockDepMutex<T, L>
impl<T, L> MutexLike for LockDepMutex<T, L>
type Guard<'a> = LockDepGuard<'a, T> where T: 'a, L: 'a
type Context = <DynamicLockDepMutex<T> as MutexLike>::Context
fn context() -> Self::Context
Source§fn lock(&self, context: &mut Self::Context) -> Self::Guard<'_>
fn lock(&self, context: &mut Self::Context) -> Self::Guard<'_>
Lock the mutex.
level is the index of the locked mutex in the lock ordering.fn key(&self) -> *const ()where
Self: Sized,
Source§impl<T, L> ResetDependencies for LockDepMutex<T, L>
impl<T, L> ResetDependencies for LockDepMutex<T, L>
Source§unsafe fn reset_dependencies(&self)
unsafe fn reset_dependencies(&self)
Resets the lock dependency graph for this lock. Read more
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
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