type EitherErr<A, B> = Either<(<A as TryFuture>::Error, B), (<B as TryFuture>::Error, A)>;

Aliased Type§

enum EitherErr<A, B> {
    Left((<A as TryFuture>::Error, B)),
    Right((<B as TryFuture>::Error, A)),
}

Variants§

§

Left((<A as TryFuture>::Error, B))

First branch of the type

§

Right((<B as TryFuture>::Error, A))

Second branch of the type

Implementations§

source§

impl<A, B> Either<A, B>

source

pub fn as_pin_ref(self: Pin<&Self>) -> Either<Pin<&A>, Pin<&B>>

Convert Pin<&Either<A, B>> to Either<Pin<&A>, Pin<&B>>, pinned projections of the inner variants.

source

pub fn as_pin_mut(self: Pin<&mut Self>) -> Either<Pin<&mut A>, Pin<&mut B>>

Convert Pin<&mut Either<A, B>> to Either<Pin<&mut A>, Pin<&mut B>>, pinned projections of the inner variants.

source§

impl<A, B, T> Either<(T, A), (T, B)>

source

pub fn factor_first(self) -> (T, Either<A, B>)

Factor out a homogeneous type from an either of pairs.

Here, the homogeneous type is the first element of the pairs.

source§

impl<A, B, T> Either<(A, T), (B, T)>

source

pub fn factor_second(self) -> (Either<A, B>, T)

Factor out a homogeneous type from an either of pairs.

Here, the homogeneous type is the second element of the pairs.

source§

impl<T> Either<T, T>

source

pub fn into_inner(self) -> T

Extract the value of an either over two equivalent types.

Trait Implementations§

source§

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

source§

fn poll_fill_buf( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<&[u8]>>

Attempt to return the contents of the internal buffer, filling it with more data from the inner reader if it is empty. Read more
source§

fn consume(self: Pin<&mut Self>, amt: usize)

Tells this buffer that amt bytes have been consumed from the buffer, so they should no longer be returned in calls to poll_read. Read more
source§

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

source§

fn poll_read( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut [u8] ) -> Poll<Result<usize>>

Attempt to read from the AsyncRead into buf. Read more
source§

fn poll_read_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &mut [IoSliceMut<'_>] ) -> Poll<Result<usize>>

Attempt to read from the AsyncRead into bufs using vectored IO operations. Read more
source§

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

source§

fn poll_seek( self: Pin<&mut Self>, cx: &mut Context<'_>, pos: SeekFrom ) -> Poll<Result<u64>>

Attempt to seek to an offset, in bytes, in a stream. Read more
source§

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

source§

fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8] ) -> Poll<Result<usize>>

Attempt to write bytes from buf into the object. Read more
source§

fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>] ) -> Poll<Result<usize>>

Attempt to write bytes from bufs into the object using vectored IO operations. Read more
source§

fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>

Attempt to flush the object, ensuring that any buffered data reach their destination. Read more
source§

fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>

Attempt to close the object. Read more
source§

impl<A: Clone, B: Clone> Clone for Either<A, B>

source§

fn clone(&self) -> Either<A, B>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<A: Debug, B: Debug> Debug for Either<A, B>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<A, B> FusedFuture for Either<A, B>where A: FusedFuture, B: FusedFuture<Output = A::Output>,

source§

fn is_terminated(&self) -> bool

Returns true if the underlying future should no longer be polled.
source§

impl<A, B> FusedStream for Either<A, B>where A: FusedStream, B: FusedStream<Item = A::Item>,

source§

fn is_terminated(&self) -> bool

Returns true if the stream should no longer be polled.
source§

impl<A, B> Future for Either<A, B>where A: Future, B: Future<Output = A::Output>,

§

type Output = <A as Future>::Output

The type of value produced on completion.
source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
source§

impl<A, B, Item> Sink<Item> for Either<A, B>where A: Sink<Item>, B: Sink<Item, Error = A::Error>,

§

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

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

fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<(), Self::Error>>

Attempts to prepare the Sink to receive a value. Read more
source§

fn start_send(self: Pin<&mut Self>, item: Item) -> Result<(), Self::Error>

Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to poll_ready which returned Poll::Ready(Ok(())). Read more
source§

fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<(), Self::Error>>

Flush any remaining output from this sink. Read more
source§

fn poll_close( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<(), Self::Error>>

Flush any remaining output and close this sink, if necessary. Read more
source§

impl<A, B> Stream for Either<A, B>where A: Stream, B: Stream<Item = A::Item>,

§

type Item = <A as Stream>::Item

Values yielded by the stream.
source§

fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Option<Self::Item>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more