plumb

Crates.ioplumb
lib.rsplumb
version0.2.0
sourcesrc
created_at2021-09-06 23:46:59.083385
updated_at2021-09-15 20:46:51.536625
descriptionA functional, async pipeline framework
homepage
repositoryhttps://github.com/ear7h/plumb
max_upload_size
id447746
size34,938
Julio (ear7h)

documentation

https://docs.rs/plumb/

README

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
Commit count: 6

cargo fmt