[][src]Macro futures_util::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 activated by default.

Examples

use futures::join;

let a = async { 1 };
let b = async { 2 };

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