Enum futures_util::future::Either [−][src]
pub enum Either<A, B> { Left(A), Right(B), }
Combines two different futures, streams, or sinks having the same associated types into a single type.
Variants
First branch of the type
Second branch of the type
Implementations
impl<A, B, T> Either<(T, A), (T, B)>
[src][−]
pub fn factor_first(self) -> (T, Either<A, B>)
[src][−]
Factor out a homogeneous type from an either of pairs.
Here, the homogeneous type is the first element of the pairs.
impl<A, B, T> Either<(A, T), (B, T)>
[src][−]
pub fn factor_second(self) -> (Either<A, B>, T)
[src][−]
Factor out a homogeneous type from an either of pairs.
Here, the homogeneous type is the second element of the pairs.
impl<T> Either<T, T>
[src][−]
pub fn into_inner(self) -> T
[src][−]
Extract the value of an either over two equivalent types.
Trait Implementations
impl<A: Clone, B: Clone> Clone for Either<A, B>
[src][+]
impl<A: Debug, B: Debug> Debug for Either<A, B>
[src][+]
impl<A, B> FusedFuture for Either<A, B> where
A: FusedFuture,
B: FusedFuture<Output = A::Output>,
[src][+]
A: FusedFuture,
B: FusedFuture<Output = A::Output>,
impl<A, B> FusedStream for Either<A, B> where
A: FusedStream,
B: FusedStream<Item = A::Item>,
[src][+]
A: FusedStream,
B: FusedStream<Item = A::Item>,
impl<A, B> Future for Either<A, B> where
A: Future,
B: Future<Output = A::Output>,
[src][+]
A: Future,
B: Future<Output = A::Output>,
impl<A, B, Item> Sink<Item> for Either<A, B> where
A: Sink<Item>,
B: Sink<Item, Error = A::Error>,
[src][+]
A: Sink<Item>,
B: Sink<Item, Error = A::Error>,
impl<A, B> Stream for Either<A, B> where
A: Stream,
B: Stream<Item = A::Item>,
[src][+]
A: Stream,
B: Stream<Item = A::Item>,
Auto Trait Implementations
impl<A, B> Send for Either<A, B> where
A: Send,
B: Send,
A: Send,
B: Send,
impl<A, B> Sync for Either<A, B> where
A: Sync,
B: Sync,
A: Sync,
B: Sync,
impl<A, B> Unpin for Either<A, B> where
A: Unpin,
B: Unpin,
A: Unpin,
B: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<F> IntoFuture for F where
F: Future,
[src][+]
F: Future,
impl<T, Item> SinkExt<Item> for T where
T: Sink<Item> + ?Sized,
[src][+]
T: Sink<Item> + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<F, T, E> TryFuture for F where
F: Future<Output = Result<T, E>> + ?Sized,
[src][+]
F: Future<Output = Result<T, E>> + ?Sized,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<S, T, E> TryStream for S where
S: Stream<Item = Result<T, E>> + ?Sized,
[src][+]
S: Stream<Item = Result<T, E>> + ?Sized,