Skip to main content

MutexLike

Trait MutexLike 

Source
pub trait MutexLike {
    type Guard<'a>
       where Self: 'a;

    // Required method
    fn lock(&self, level: usize) -> Self::Guard<'_>;
}
Expand description

A generic mutex for the ordered_lock operations.

Required Associated Types§

Source

type Guard<'a> where Self: 'a

Required Methods§

Source

fn lock(&self, level: usize) -> Self::Guard<'_>

Lock the mutex. level is the index of the locked mutex in the lock ordering.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> MutexLike for DynamicLockDepMutex<T>

Source§

type Guard<'a> = LockDepGuard<'a, T> where T: 'a

Source§

impl<T> MutexLike for Mutex<T>

Source§

type Guard<'a> = MutexGuard<'a, RawSyncMutex, T> where T: 'a

Source§

impl<T, L> MutexLike for LockDepMutex<T, L>

Source§

type Guard<'a> = LockDepGuard<'a, T> where T: 'a, L: 'a