Trait LockRef

Source
pub trait LockRef:
    Send
    + Sync
    + 'static {
    type Inner;
    type Output<'a>: Deref<Target = Self::Inner> + Send;

    // Required method
    fn lock_ref<'a>(&'a self) -> impl Future<Output = Self::Output<'a>> + Send;
}
Expand description

Locking primitives, Immutable Access

Required Associated Types§

Source

type Inner

Source

type Output<'a>: Deref<Target = Self::Inner> + Send

Required Methods§

Source

fn lock_ref<'a>(&'a self) -> impl Future<Output = Self::Output<'a>> + Send

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<T: Send + Sync + 'static> LockRef for Mutex<T>

Source§

type Inner = T

Source§

type Output<'a> = MutexGuard<'a, T>

Source§

fn lock_ref<'a>(&'a self) -> impl Future<Output = Self::Output<'a>> + Send

Source§

impl<T: Send + Sync + 'static> LockRef for RwLock<T>

Source§

type Inner = T

Source§

type Output<'a> = RwLockReadGuard<'a, T>

Source§

fn lock_ref<'a>(&'a self) -> impl Future<Output = Self::Output<'a>> + Send

Implementors§