Skip to main content

Pipe

Trait Pipe 

Source
pub trait Pipe: Sized {
    // Provided methods
    async fn tap_async(self, func: impl AsyncFnOnce(&mut Self)) -> Self { ... }
    fn tap(self, func: impl FnOnce(&mut Self)) -> Self { ... }
    fn pipe<R: Sized>(self, func: impl FnOnce(Self) -> R) -> R { ... }
    fn pipe_as<'a, T: 'a + ?Sized, R: 'a + Sized>(
        &'a self,
        func: impl FnOnce(&'a T) -> R,
    ) -> R
       where Self: Deref<Target = T> { ... }
}

Provided Methods§

Source

async fn tap_async(self, func: impl AsyncFnOnce(&mut Self)) -> Self

Source

fn tap(self, func: impl FnOnce(&mut Self)) -> Self

Source

fn pipe<R: Sized>(self, func: impl FnOnce(Self) -> R) -> R

Source

fn pipe_as<'a, T: 'a + ?Sized, R: 'a + Sized>( &'a self, func: impl FnOnce(&'a T) -> R, ) -> R
where Self: Deref<Target = 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> Pipe for T