Crate pipei

Crate pipei 

Source
Expand description

§pipei

pipei provides pipe-style partial application combinators.

For each arity i ≥ 0, enabling feature "i" exports:

  • Pipe{i}Ref — borrow-based pipes
  • Pipe{i} — by-value pipes
  • Tap{i}Ref — borrow-based taps (discard return, return self for chaining)
  • Tap{i} — by-value taps (discard return, return self for chaining)

Laws (schematic):

self.pipe{i}(f)(a1..ai)                = f(self,            a1..ai)
self.pipe{i}_with(proj, f)(a1..ai)     = f(proj(&self),     a1..ai)
self.pipe{i}_with_mut(proj, f)(a1..ai) = f(proj(&mut self), a1..ai)

self.tap{i}(f)(a1..ai)                 = { let _ = f(&mut self, a1..ai); self }
self.tap{i}_with(proj, f)(a1..ai)      = { let _ = f(proj(&self), a1..ai); &self }
self.tap{i}_with_mut(proj, f)(a1..ai)  = { let _ = f(proj(&mut self), a1..ai); &mut self }

Only the arities whose numeric feature is enabled are compiled.

Structs§

Imm
Mut

Traits§

Pipe0
By-value arity-0 piping.
Pipe0Ref
Pipe1
Adds by-value partial application for arity 1 (requires Self: Sized).
Pipe2
Adds by-value partial application for arity 2 (requires Self: Sized).
Pipe3
Adds by-value partial application for arity 3 (requires Self: Sized).
Pipe4
Adds by-value partial application for arity 4 (requires Self: Sized).
Pipe5
Adds by-value partial application for arity 5 (requires Self: Sized).
Pipe1Ref
Pipe-style helpers for partial application of (first, A1..A1) -> R functions.
Pipe2Ref
Pipe-style helpers for partial application of (first, A1..A2) -> R functions.
Pipe3Ref
Pipe-style helpers for partial application of (first, A1..A3) -> R functions.
Pipe4Ref
Pipe-style helpers for partial application of (first, A1..A4) -> R functions.
Pipe5Ref
Pipe-style helpers for partial application of (first, A1..A5) -> R functions.
Tap0
Tap0Ref
Tap1
Adds by-value tap helpers for arity 1 (requires Self: Sized).
Tap2
Adds by-value tap helpers for arity 2 (requires Self: Sized).
Tap3
Adds by-value tap helpers for arity 3 (requires Self: Sized).
Tap4
Adds by-value tap helpers for arity 4 (requires Self: Sized).
Tap5
Adds by-value tap helpers for arity 5 (requires Self: Sized).
Tap1Ref
Tap-style helpers for calling (first, A1..A1) -> R for side effects.
Tap2Ref
Tap-style helpers for calling (first, A1..A2) -> R for side effects.
Tap3Ref
Tap-style helpers for calling (first, A1..A3) -> R for side effects.
Tap4Ref
Tap-style helpers for calling (first, A1..A4) -> R for side effects.
Tap5Ref
Tap-style helpers for calling (first, A1..A5) -> R for side effects.