Trait futures_concurrency::future::FutureExt
source · pub trait FutureExt: Future {
// Required methods
fn join<S2>(self, other: S2) -> Join2<Self, S2::IntoFuture>
where Self: Future + Sized,
S2: IntoFuture;
fn race<T, S2>(self, other: S2) -> Race2<T, Self, S2::IntoFuture>
where Self: Future<Output = T> + Sized,
S2: IntoFuture<Output = T>;
}
Expand description
An extension trait for the Future
trait.
Required Methods§
sourcefn join<S2>(self, other: S2) -> Join2<Self, S2::IntoFuture>where
Self: Future + Sized,
S2: IntoFuture,
fn join<S2>(self, other: S2) -> Join2<Self, S2::IntoFuture>where Self: Future + Sized, S2: IntoFuture,
Wait for both futures to complete.
sourcefn race<T, S2>(self, other: S2) -> Race2<T, Self, S2::IntoFuture>where
Self: Future<Output = T> + Sized,
S2: IntoFuture<Output = T>,
fn race<T, S2>(self, other: S2) -> Race2<T, Self, S2::IntoFuture>where Self: Future<Output = T> + Sized, S2: IntoFuture<Output = T>,
Wait for the first future to complete.