type EitherOk<A, B> = Either<(<A as TryFuture>::Ok, B), (<B as TryFuture>::Ok, A)>;
Aliased Type§
enum EitherOk<A, B> {
Left((<A as TryFuture>::Ok, B)),
Right((<B as TryFuture>::Ok, A)),
}
Variants§
Left((<A as TryFuture>::Ok, B))
First branch of the type
Right((<B as TryFuture>::Ok, A))
Second branch of the type
Implementations
Source§impl<A, B, T> Either<(A, T), (B, T)>
impl<A, B, T> Either<(A, T), (B, T)>
Sourcepub fn factor_second(self) -> (Either<A, B>, T)
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<A, B, T> Either<(T, A), (T, B)>
impl<A, B, T> Either<(T, A), (T, B)>
Sourcepub fn factor_first(self) -> (T, Either<A, B>)
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> Either<A, B>
impl<A, B> Either<A, B>
Source§impl<T> Either<T, T>
impl<T> Either<T, T>
Sourcepub fn into_inner(self) -> T
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,
impl<A, B> AsyncBufRead for Either<A, B>where
A: AsyncBufRead,
B: AsyncBufRead,
Source§impl<A, B> AsyncRead for Either<A, B>
impl<A, B> AsyncRead for Either<A, B>
Source§impl<A, B> AsyncWrite for Either<A, B>where
A: AsyncWrite,
B: AsyncWrite,
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>>
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 moreSource§fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<Result<usize>>
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 moreSource§impl<A, B> FusedFuture for Either<A, B>
impl<A, B> FusedFuture for Either<A, B>
Source§fn is_terminated(&self) -> bool
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>
impl<A, B> FusedStream for Either<A, B>
Source§fn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
Returns
true
if the stream should no longer be polled.Source§impl<A, B, Item> Sink<Item> for Either<A, B>
impl<A, B, Item> Sink<Item> for Either<A, B>
Source§type Error = <A as Sink<Item>>::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>>
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Attempts to prepare the
Sink
to receive a value. Read moreSource§fn start_send(self: Pin<&mut Self>, item: Item) -> Result<(), Self::Error>
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