#async #pipeline #framework #bind #seq #ok #aseq

plumb

A functional, async pipeline framework

2 unstable releases

0.2.0 Sep 15, 2021
0.1.1 Sep 7, 2021
0.1.0 Sep 6, 2021

#1417 in Asynchronous

Download history 17/week @ 2024-02-19 47/week @ 2024-02-26 9/week @ 2024-03-04 19/week @ 2024-03-11 6/week @ 2024-03-18

82 downloads per month
Used in http-mux

Custom license

28KB
846 lines

plumb

A pipeline framework

pub async fn test() -> Result<bool, f32> {
    async fn always_true(_a : i32, _b : i32, _s : &str) -> bool {
        true
    }

    id::<i32>()
    .bind(20 as i32)
    .bind("hello")
    .aseq(always_true)
    .tuple()
    .seq(|b : bool| {
        Ok((!b,))
    })
    .map(|b:bool| {
        !b
    })
    .map_tuple()
    .map_bind("abc")
    .amap(|_b:bool, _s : &str| async {
        false
    })
    .map_tuple()
    .and_then(|_| {
        Err(1.1)
    })
    .run(12).await
}

TODO:

  • documentation
  • map_err
  • or_* methods
  • iter_parallel, fold_parallel

No runtime deps