pub trait ReadApi {
    type Target;
    type ReadGuard<'a>: Deref<Target = Self::Target>
       where Self: 'a;

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

Provides constant part of the ReadWriteApi interface.

Required Associated Types§

source

type Target

Dereference target of the return type of the Self::read method.

source

type ReadGuard<'a>: Deref<Target = Self::Target> where Self: 'a

Self::read return type.

Required Methods§

source

fn read(&self) -> Self::ReadGuard<'_>

[RwLock::read] analogue.

Implementations on Foreign Types§

source§

impl<T> ReadApi for &mut RwLock<T>

§

type Target = T

§

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

source§

fn read(&self) -> RwLockReadGuard<'_, T>

source§

impl<T> ReadApi for &mut Twhere T: AutoReadApi,

§

type Target = <T as AutoReadApi>::Target

§

type ReadGuard<'a> = &'a <T as AutoReadApi>::Target where Self: 'a

source§

fn read(&self) -> &Self::Target

source§

impl<T> ReadApi for &RwLock<T>

§

type Target = T

§

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

source§

fn read(&self) -> RwLockReadGuard<'_, T>

source§

impl<T> ReadApi for &Twhere T: AutoReadApi,

§

type Target = <T as AutoReadApi>::Target

§

type ReadGuard<'a> = &'a <T as AutoReadApi>::Target where Self: 'a

source§

fn read(&self) -> &Self::Target

source§

impl<T> ReadApi for RwLock<T>

§

type Target = T

§

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

source§

fn read(&self) -> RwLockReadGuard<'_, T>

Implementors§