MappableDerefMut

Trait MappableDerefMut 

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

This trait provides compatibility between [&mut T] and parking_lot::RwLockWriteGuard

Required Methods§

Source

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

This method is similar to parking_lot::RwLockWriteGuard::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> MappableDerefMut<'a> for &'a mut T
where T: ?Sized,

Source§

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

Source§

impl<'a, T> MappableDerefMut<'a> for MappedRwLockWriteGuard<'a, T>
where T: ?Sized + 'a,

Source§

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

Source§

impl<'a, T> MappableDerefMut<'a> for RwLockWriteGuard<'a, T>
where T: ?Sized + 'a,

Source§

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

Implementors§