pipa
Pipe Operator Library for Rust.
Features:
- Pipe things into chain of expressions.
- Support different types.
- Support pipe for functions, closures and methods returning
Try-able types(Option & Result). - Support pipe for async functions and async methods returning
Try-able types(Option & Result). - Support pipe for associated functions returning
Try-able types(Option & Result). - Support pipe for async associated functions returning
Try-able types(Option & Result). - Support pipe for methods calls returning
Try-able types(Option & Result). - Support pipe for async methods calls returning
Try-able types(Option & Result). - Support pipe for inline closures.
- Support Railway-Oriented Programming pattern with simple and terse syntax.
Example:
let ret = pipa!;
let ret = pipa_try!;
let ret = pipa_await_try!;
Example mixing multiple kinds of expressions:
let clo = ;
let result = p!;
let ret = p!;
assert_eq!;
let ret = p!;
assert_eq!;
// inline closure tests
let ret = p!;
assert_eq!;
dbg!;
let ret = p!;
assert_eq!;
dbg!;
let ret = p!;
assert_eq!;
dbg!;
let ret = p!;
assert_eq!;
dbg!;
let ret = p!;
assert_eq!;
dbg!;
let ret = p!;
assert_eq!;
dbg!;
let ret = p!;
assert_eq!;
dbg!;
More detail in tests/test.rs & tests/mixed_test.rs.