Tap0Ref

Trait Tap0Ref 

Source
pub trait Tap0Ref {
    // Provided methods
    fn tap0_with<'a, X: ?Sized + 'a, R>(
        &'a self,
        proj: impl FnOnce(&'a Self) -> &'a X,
        f: impl FnOnce(&'a X) -> R,
    ) -> impl FnOnce() -> &'a Self { ... }
    fn tap0_with_mut<'a, X: ?Sized + 'a, M, F>(
        &'a mut self,
        proj: impl FnOnce(&mut Self) -> &mut X,
        f: F,
    ) -> impl FnOnce() -> &'a mut Self
       where F: Tap0Fn<X, M> { ... }
}

Provided Methods§

Source

fn tap0_with<'a, X: ?Sized + 'a, R>( &'a self, proj: impl FnOnce(&'a Self) -> &'a X, f: impl FnOnce(&'a X) -> R, ) -> impl FnOnce() -> &'a Self

Immutable view tap. Always takes Fn(&T).

Source

fn tap0_with_mut<'a, X: ?Sized + 'a, M, F>( &'a mut self, proj: impl FnOnce(&mut Self) -> &mut X, f: F, ) -> impl FnOnce() -> &'a mut Self
where F: Tap0Fn<X, M>,

Mutable view tap. Accepts BOTH Fn(&mut T) and Fn(&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<T: ?Sized> Tap0Ref for T