[−][src]Function safina::select_ab
pub async fn select_ab<A, B, FutA, FutB>(
fut_a: FutA,
fut_b: FutB
) -> OptionAB<A, B> where
FutA: Future<Output = A> + Send + 'static,
FutB: Future<Output = B> + Send + 'static,
Awaits both 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.