[][src]Macro futures::join

macro_rules! join {
    ($($tokens:tt)*) => { ... };
}

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

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

This macro is only usable inside of async functions, closures, and blocks. It is also gated behind the async-await feature of this library, which is not activated by default.

Examples

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

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

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