# [−][src]Enum futures::future::Either

```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

`Left(A)`

First branch of the type

`Right(B)`

Second branch of the type

## Methods

### `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, B> Future for Either<A, B> where    A: Future,    B: Future<Output = <A as Future>::Output>, `[src]

#### `type Output = <A as Future>::Output`

The type of value produced on completion.

### `impl<A, B, Item> Sink<Item> for Either<A, B> where    A: Sink<Item>,    B: Sink<Item, Error = <A as Sink<Item>>::Error>, `[src]

#### `type Error = <A as Sink<Item>>::Error`

The type of value produced by the sink when an error occurs.

### `impl<A, B> Stream for Either<A, B> where    A: Stream,    B: Stream<Item = <A as Stream>::Item>, `[src]

#### `type Item = <A as Stream>::Item`

Values yielded by the stream.

## Blanket Implementations

### `impl<T> ToOwned for T where    T: Clone, `[src]

#### `type Owned = T`

The resulting type after obtaining ownership.

### `impl<T, U> TryFrom<U> for T where    U: Into<T>, `[src]

#### `type Error = Infallible`

The type returned in the event of a conversion error.

### `impl<T, U> TryInto<U> for T where    U: TryFrom<T>, `[src]

#### `type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.

### `impl<F, T, E> TryFuture for F where    F: Future<Output = Result<T, E>> + ?Sized, `[src]

#### `type Ok = T`

The type of successful values yielded by this future

#### `type Error = E`

The type of failures yielded by this future

### `impl<S, T, E> TryStream for S where    S: Stream<Item = Result<T, E>> + ?Sized, `[src]

#### `type Ok = T`

The type of successful values yielded by this future

#### `type Error = E`

The type of failures yielded by this future