Skip to main content

MapDerefExt

Trait MapDerefExt 

Source
pub trait MapDerefExt: Sized + Deref {
    // Required method
    fn map_deref<F, T>(self, f: F) -> MapDeref<Self, T, F>
       where F: Fn(&Self::Target) -> &T;
}
Expand description

A trait providing an easy way to instantiate MapDeref.

Required Methods§

Source

fn map_deref<F, T>(self, f: F) -> MapDeref<Self, T, F>
where F: Fn(&Self::Target) -> &T,

Maps this value from the current Deref::Target to T.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S> MapDerefExt for S
where S: Deref,