Function ::std::future::join

Overview
async fn join(value)

Waits for a collection of futures to complete and joins their result.

Examples

let a = async { 1 };
let b = async { 2 };
let (a, b) = std::future::join((a, b)).await;
assert_eq!(1, a);
assert_eq!(2, b);

Using a vector:

let a = async { 1 };
let b = async { 2 };
let [a, b] = std::future::join([a, b]).await;
assert_eq!(1, a);
assert_eq!(2, b);

Joining an empty collection:

let () = std::future::join(()).await;
let [] = std::future::join([]).await;