#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

#1536 in Asynchronous

Download history 11/week @ 2024-11-13 18/week @ 2024-11-20 13/week @ 2024-11-27 41/week @ 2024-12-04 39/week @ 2024-12-11 8/week @ 2024-12-18 2/week @ 2024-12-25 49/week @ 2025-01-08 13/week @ 2025-01-15 3/week @ 2025-01-22 31/week @ 2025-01-29 34/week @ 2025-02-05 9/week @ 2025-02-12 71/week @ 2025-02-19 32/week @ 2025-02-26

149 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

~265–720KB
~16K SLoC