Crates.io | async_monad |
lib.rs | async_monad |
version | 0.2.0 |
source | src |
created_at | 2023-12-02 13:34:10.272777 |
updated_at | 2024-01-01 10:58:59.987048 |
description | Asynchronous monad for rust |
homepage | |
repository | https://github.com/Embers-of-the-Fire/async-monad/ |
max_upload_size | |
id | 1056117 |
size | 53,150 |
This library is designed for using monads like core::Result
and core::Option
in asynchronous control flow.
The async_monad::async_wrapped
offers the inner-async version of Result
and Option
.
These monads save the Future
inside it, which allows you to use them synchronously and
wait at one time.
Typically, all operations over them will create a new Future
, moving and cloning all
associated data, so theperformance will be (somehow much) worse than handle them manually.
The rest methods (which are tagged as async
) will consume the Future
and produce some
result.
The async_monad::async_traits
offers the asynchronous version of std apis, which accepts
Future
s and asynchronous functions.
The utility is hidden behind the async_trait
feature, which is enabled by default.
Since it uses the feature which went stable since Rustc 1.75, you have to update your rustc
through rustup
or disable the feature manually.