async_monad 0.2.0

Asynchronous monad for rust
Documentation
/// This module provides an asynchronous version of the rust's standard `Option` enum.
/// 
/// ```
/// # use tokio::runtime::Runtime;
/// use async_monad::async_traits::option::AsyncOption;
/// 
/// # let runtime = Runtime::new().unwrap();
/// # runtime.block_on(async {
/// async fn do_sth(val: u32) -> Option<u32> {
///     if val % 2 == 0 {
///         None
///     } else {
///         Some(val + 1)
///     }
/// }
/// assert_eq!(Some(5_u32).aand_then(do_sth).await, Some(6));
/// assert_eq!(Some(6_u32).aand_then(do_sth).await, None);
/// # });
/// ```
pub mod option;

/// This module provides an asynchronous version of the rust's standard `Result` enum.
/// 
/// ```
/// # use tokio::runtime::Runtime;
/// use async_monad::async_traits::result::AsyncResult;
/// 
/// # let runtime = Runtime::new().unwrap();
/// # runtime.block_on(async {
/// async fn do_sth(val: u32) -> Result<u32, u32> {
///     if val % 2 == 0 {
///         Ok(val * 2)
///     } else {
///         Err(val + 1)
///     }
/// }
/// assert_eq!(Ok(5_u32).aand_then(do_sth).await, Err(6));
/// assert_eq!(Ok(6_u32).aand_then(do_sth).await, Ok(12));
/// # });
/// ```
pub mod result;