Enum actix::fut::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

Left(A)

First branch of the type

Right(B)

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, B, Act> ActorFuture<Act> for Either<A, B> where
    A: ActorFuture<Act>,
    B: ActorFuture<Act, Output = A::Output>,
    Act: Actor
[src]

type Output = A::Output

The type of value that this future will resolved with if it is successful. Read more

impl<A, B> Clone for Either<A, B> where
    A: Clone,
    B: Clone
[src]

impl<A, B> Debug for Either<A, B> where
    A: Debug,
    B: Debug
[src]

impl<A, B> FusedFuture for Either<A, B> where
    A: FusedFuture,
    B: FusedFuture<Output = <A as Future>::Output>, 
[src]

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

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

Auto Trait Implementations

impl<A, B> RefUnwindSafe for Either<A, B> where
    A: RefUnwindSafe,
    B: RefUnwindSafe

impl<A, B> Send for Either<A, B> where
    A: Send,
    B: Send

impl<A, B> Sync for Either<A, B> where
    A: Sync,
    B: Sync

impl<A, B> Unpin for Either<A, B> where
    A: Unpin,
    B: Unpin

impl<A, B> UnwindSafe for Either<A, B> where
    A: UnwindSafe,
    B: UnwindSafe

Blanket Implementations

impl<F, A> ActorFutureExt<A> for F where
    F: ActorFuture<A>,
    A: Actor
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FutureExt for T where
    T: Future + ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F, A> IntoActorFuture<A> for F where
    F: ActorFuture<A>,
    A: Actor
[src]

type Future = F

The future that this type can be converted into.

type Output = <F as ActorFuture<A>>::Output

The item that the future may resolve with.

impl<F> IntoFuture for F where
    F: Future
[src]

type Output = <F as Future>::Output

🔬 This is a nightly-only experimental API. (into_future)

The output that the future will produce on completion.

type Future = F

🔬 This is a nightly-only experimental API. (into_future)

Which kind of future are we turning this into?

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

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<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<Fut> TryFutureExt for Fut where
    Fut: TryFuture + ?Sized
[src]

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

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]

impl<F, A> WrapFuture<A> for F where
    F: Future,
    A: Actor
[src]

type Future = FutureWrap<F, A>

The future that this type can be converted into.

type Output = <F as Future>::Output

The item that the future may resolve with.

impl<S, A> WrapStream<A> for S where
    A: Actor,
    S: Stream
[src]

type Stream = StreamWrap<S, A>

The stream that this type can be converted into.

type Item = <S as Stream>::Item

The item that the future may resolve with.