#async #higher-order #traits #function #extention #prelude #hofs

no-std async-hofs

Various extention traits for providing asynchronous higher-order functions

2 releases

0.1.1 Jun 28, 2022
0.1.0 Jun 24, 2022

#24 in #higher-order

Download history 32/week @ 2024-04-10 16/week @ 2024-04-17 5/week @ 2024-04-24 15/week @ 2024-05-01 10/week @ 2024-05-08 6/week @ 2024-05-15 9/week @ 2024-05-22 4/week @ 2024-05-29 11/week @ 2024-06-05 12/week @ 2024-06-12 13/week @ 2024-06-19 16/week @ 2024-06-26 7/week @ 2024-07-03 19/week @ 2024-07-10 18/week @ 2024-07-17 25/week @ 2024-07-24

69 downloads per month
Used in ghr

MIT license

22KB
471 lines

async-hofs

Various extention traits for providing asynchronous higher-order functions.

crates.io docs.rs MIT licensed CI Status

// This won't make any name conflicts since all imports inside prelude are anonymous.
use async_hofs::prelude::*;

assert_eq!(
    Some(1).async_map(|x| async move { x + 2 }).await,
    Some(3),
);

type Result = core::result::Result<i32, i32>;

assert_eq!(
    Result::Ok(1).async_and_then(|_| async move { Err(77) }).await,
    Result::Err(77)
);

Dependencies

~320–780KB
~17K SLoC