MappableDeref

Trait MappableDeref 

Source
pub trait MappableDeref<'a>: Deref + SealedMappableDeref {
    // Required method
    fn map<U, F>(self, f: F) -> impl MappableDeref<'a, Target = U>
       where U: ?Sized + 'a,
             F: FnOnce(&Self::Target) -> &U;
}
Expand description

This trait provides compatibility between &T and parking_lot::RwLockReadGuard

Required Methods§

Source

fn map<U, F>(self, f: F) -> impl MappableDeref<'a, Target = U>
where U: ?Sized + 'a, F: FnOnce(&Self::Target) -> &U,

This method is similar to parking_lot::RwLockReadGuard::map and its sibling methods.

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> MappableDeref<'a> for &'a T
where T: ?Sized,

Source§

fn map<U, F>(self, f: F) -> impl MappableDeref<'a, Target = U>
where U: ?Sized + 'a, F: FnOnce(&T) -> &U,

Source§

impl<'a, T> MappableDeref<'a> for MappedRwLockReadGuard<'a, T>
where T: ?Sized + 'a,

Source§

fn map<U, F>(self, f: F) -> impl MappableDeref<'a, Target = U>
where U: ?Sized + 'a, F: FnOnce(&T) -> &U,

Source§

impl<'a, T> MappableDeref<'a> for RwLockReadGuard<'a, T>
where T: ?Sized + 'a,

Source§

fn map<U, F>(self, f: F) -> impl MappableDeref<'a, Target = U>
where U: ?Sized + 'a, F: FnOnce(&T) -> &U,

Implementors§