pub type MappedRwLockReadGuard<'a, T> = MappedRwLockReadGuard<'a, RawRwLock, T>;
Expand description

An RAII read lock guard returned by RwLockReadGuard::map, which can point to a subfield of the protected data.

The main difference between MappedRwLockReadGuard and RwLockReadGuard is that the former doesn’t support temporarily unlocking and re-locking, since that could introduce soundness issues if the locked object is modified by another thread.

Aliased Type§

struct MappedRwLockReadGuard<'a, T> {
    raw: &'a RawRwLock,
    data: *const T,
    marker: PhantomData<&'a T>,
}

Fields§

§raw: &'a RawRwLock§data: *const T§marker: PhantomData<&'a T>

Trait Implementations§

source§

impl<'a, R, T> Deref for MappedRwLockReadGuard<'a, R, T>where R: RawRwLock + 'a, T: 'a + ?Sized,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.