[][src]Macro futures::join

macro_rules! join {
    ( $ ( $ fut : ident ) , * ) => { ... };
}

Polls multiple futures simultaneously, returning a tuple of all results once complete.

While join!(a, b) is similar to (await!(a), await!(b)), join! polls both futures concurrently and therefore is more efficent.

This macro is only usable inside of async functions, closures, and blocks.

Examples

#![feature(pin, async_await, await_macro, futures_api)]
use futures::{join, future};

let a = future::ready(1);
let b = future::ready(2);

assert_eq!(join!(a, b), (1, 2));