Lines Matching full:either
1 use crate::future::{Either, TryFutureExt};
15 type EitherOk<A, B> = Either<(<A as TryFuture>::Ok, B), (<B as TryFuture>::Ok, A)>;
16 type EitherErr<A, B> = Either<(<A as TryFuture>::Error, B), (<B as TryFuture>::Error, A)>;
18 /// Waits for either one of two differently-typed futures to complete.
20 /// This function will return a new future which awaits for either one of both
28 /// success/error type you can use the `Either::factor_first` method to
34 /// use futures::future::{self, Either, Future, FutureExt, TryFuture, TryFutureExt};
45 /// Ok(Either::Left((x, b))) => Box::new(b.map_ok(move |y| (x, y))),
46 /// Ok(Either::Right((y, a))) => Box::new(a.map_ok(move |x| (x, y))),
47 /// Err(Either::Left((e, _))) => Box::new(future::err(e)),
48 /// Err(Either::Right((e, _))) => Box::new(future::err(e)),
73 Poll::Ready(Err(x)) => Poll::Ready(Err(Either::Left((x, b)))), in poll()
74 Poll::Ready(Ok(x)) => Poll::Ready(Ok(Either::Left((x, b)))), in poll()
76 Poll::Ready(Err(x)) => Poll::Ready(Err(Either::Right((x, a)))), in poll()
77 Poll::Ready(Ok(x)) => Poll::Ready(Ok(Either::Right((x, a)))), in poll()