Trait MapDerefExt

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

A trait providing an easy way to instantiate MapDeref.

Required Methods§

Source

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

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", so this trait is not object safe.

Implementors§

Source§

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