Trait Mutex

Source
pub trait Mutex {
    type Data;

    // Required method
    fn lock(&self) -> impl DerefMut<Target = Self::Data>;
}

Required Associated Types§

Required Methods§

Source

fn lock(&self) -> impl DerefMut<Target = Self::Data>

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.

Implementations on Foreign Types§

Source§

impl<'a, T: Mutex> Mutex for &'a T

Source§

type Data = <T as Mutex>::Data

Source§

fn lock(&self) -> impl DerefMut<Target = Self::Data>

Source§

impl<T: Mutex, F: FnOnce() -> T> Mutex for LazyCell<T, F>

Source§

type Data = <T as Mutex>::Data

Source§

fn lock(&self) -> impl DerefMut<Target = Self::Data>

Implementors§

Source§

impl<T: Clone> Mutex for PreShared<T>

Source§

type Data = T