Trait ExclusiveLock

Source
pub trait ExclusiveLock<T>: 'static {
    type Guard<'l>: DerefMut<Target = T>;

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

Abstracts an exclusive lock (i.e. a Mutex).

Required Associated Types§

Source

type Guard<'l>: DerefMut<Target = T>

The guard type returned when locking the lock.

Required Methods§

Source

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

Locks this lock.

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§

impl<T: 'static> ExclusiveLock<T> for Mutex<T>