[][src]Macro join::join_async

macro_rules! join_async {
    #[proc_macro_hack(support_nested, internal_macro_calls = 20)] => { ... };
}

Use to combine futures. It produces tuple of values or single value in case of 1 branch.

#![recursion_limit="256"]

extern crate join;
extern crate futures;

use join::join_async;
use futures::future::{ready};
use futures::stream::iter;

#[tokio::main]
async fn main() {
    let filtered: Vec<_> = join_async! { iter(vec![1u8,2,3]) ?> |v| ready(v % 2 == 0) =>[] }.await;
    assert_eq!(filtered, vec![2]);
}