| Crates.io | async-hofs |
| lib.rs | async-hofs |
| version | 0.1.1 |
| created_at | 2022-06-24 12:30:32.721569+00 |
| updated_at | 2022-06-28 02:17:30.292406+00 |
| description | Various extention traits for providing asynchronous higher-order functions |
| homepage | |
| repository | https://github.com/kawaemon/async-hofs |
| max_upload_size | |
| id | 612378 |
| size | 23,562 |
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)
);