Skip to main content

RwLockLike

Trait RwLockLike 

Source
pub trait RwLockLike {
    type ReadGuard<'a>
       where Self: 'a;
    type WriteGuard<'a>
       where Self: 'a;
    type Context;

    // Required methods
    fn context() -> Self::Context;
    fn read(&self, context: &mut Self::Context) -> Self::ReadGuard<'_>;
    fn write(&self, context: &mut Self::Context) -> Self::WriteGuard<'_>;

    // Provided method
    fn key(&self) -> *const ()
       where Self: Sized { ... }
}
Expand description

A generic rwlock for the ordered_lock operations.

Required Associated Types§

Source

type ReadGuard<'a> where Self: 'a

Source

type WriteGuard<'a> where Self: 'a

Source

type Context

Required Methods§

Source

fn context() -> Self::Context

Source

fn read(&self, context: &mut Self::Context) -> Self::ReadGuard<'_>

Source

fn write(&self, context: &mut Self::Context) -> Self::WriteGuard<'_>

Provided Methods§

Source

fn key(&self) -> *const ()
where Self: Sized,

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> RwLockLike for DynamicLockDepRwLock<T>

Source§

type ReadGuard<'a> = LockDepReadGuard<'a, T> where T: 'a

Source§

type WriteGuard<'a> = LockDepWriteGuard<'a, T> where T: 'a

Source§

type Context = ()

Source§

impl<T> RwLockLike for RwLock<T>

Source§

type ReadGuard<'a> = RwLockReadGuard<'a, RawSyncRwLock, T> where T: 'a

Source§

type WriteGuard<'a> = RwLockWriteGuard<'a, RawSyncRwLock, T> where T: 'a

Source§

type Context = ()

Source§

impl<T, L> RwLockLike for LockDepRwLock<T, L>

Source§

type ReadGuard<'a> = LockDepReadGuard<'a, T> where T: 'a, L: 'a

Source§

type WriteGuard<'a> = LockDepWriteGuard<'a, T> where T: 'a, L: 'a

Source§

type Context = <DynamicLockDepRwLock<T> as RwLockLike>::Context