Function safina::select_abcd[][src]

pub async fn select_abcd<A, B, C, D, FutA, FutB, FutC, FutD>(
    a: FutA,
    b: FutB,
    c: FutC,
    d: FutD
) -> OptionABCD<A, B, C, D> where
    FutA: Future<Output = A> + Send + 'static,
    FutB: Future<Output = B> + Send + 'static,
    FutC: Future<Output = C> + Send + 'static,
    FutD: Future<Output = D> + Send + 'static, 

Awaits the futures and returns the value from the one that completes first.

First moves them to the heap, to make them Unpin. Use SelectFuture::new to avoid allocating on the heap.