Pipe2

Trait Pipe2 

Source
pub trait Pipe2: Sized + Pipe2Ref {
    // Provided method
    fn pipe2<R, A1, A2>(
        self,
        f: impl FnOnce(Self, A1, A2) -> R,
    ) -> impl FnOnce(A1, A2) -> R { ... }
}
Expand description

Adds by-value partial application for arity 2 (requires Self: Sized).

Provided Methods§

Source

fn pipe2<R, A1, A2>( self, f: impl FnOnce(Self, A1, A2) -> R, ) -> impl FnOnce(A1, A2) -> R

Partially applies f by moving self into the returned closure. The closure takes (A1..A2).

Semantics: self.pipe2(f)(a1..a2) == f(self, a1..a2).

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> Pipe2 for T