Function af_core::future::race[][src]

pub async fn race<T>(
    a: impl Future<Output = T>,
    b: impl Future<Output = T>
) -> T

Waits for one of two futures to be ready and returns its result.

The remaining future is dropped. If both futures are ready at the same time, the first future has priority.