Function safina::select_abc
source · [−]pub async fn select_abc<A, B, C, FutA, FutB, FutC>(
a: FutA,
b: FutB,
c: FutC
) -> OptionAbc<A, B, C> where
FutA: 'static + Future<Output = A> + Send,
FutB: 'static + Future<Output = B> + Send,
FutC: 'static + Future<Output = C> + Send,
Expand description
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.