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§

source

fn join<S2>(self, other: S2) -> Join2<Self, S2::IntoFuture>where Self: Future + Sized, S2: IntoFuture,

Wait for both futures to complete.

source

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.

Implementors§

source§

impl<F1> FutureExt for F1where F1: Future,