2 releases
0.1.1 | Jun 28, 2022 |
---|---|
0.1.0 | Jun 24, 2022 |
#1497 in Asynchronous
96 downloads per month
Used in ghr
22KB
471 lines
async-hofs
Various extention traits for providing asynchronous higher-order functions.
// 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–800KB
~17K SLoC