futures-async-combinators 0.3.2

toy futures combinators
1
2
3
4
5
6
7
8
9
10
11
12
13
use futures::executor;
use futures_async_combinators::future::*;

fn main() {
    executor::block_on(async {
        let future = ready(Ok::<i32, i32>(1));
        let future = and_then(future, |x| ready(Ok::<i32, i32>(x + 3)));
        let future = inspect(future, |x| {
            dbg!(x);
        });
        assert_eq!(future.await, Ok(4));
    });
}