Function futures_lite::future::zip

source ·
pub fn zip<F1, F2>(future1: F1, future2: F2) -> Zip<F1, F2> where
    F1: Future,
    F2: Future,
Expand description

Joins two futures, waiting for both to complete.

Examples

use futures_lite::future;

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

assert_eq!(future::zip(a, b).await, (1, 2));