Type Alias futures_util::future::try_select::EitherOk
source · 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> Either<A, B>
impl<A, B> Either<A, B>
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, 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<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>where
A: AsyncRead,
B: AsyncRead,
impl<A, B> AsyncRead for Either<A, B>where A: AsyncRead, B: AsyncRead,
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>where
A: FusedFuture,
B: FusedFuture<Output = A::Output>,
impl<A, B> FusedFuture for Either<A, B>where A: FusedFuture, B: FusedFuture<Output = A::Output>,
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>where
A: FusedStream,
B: FusedStream<Item = A::Item>,
impl<A, B> FusedStream for Either<A, B>where A: FusedStream, B: FusedStream<Item = A::Item>,
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>where
A: Sink<Item>,
B: Sink<Item, Error = A::Error>,
impl<A, B, Item> Sink<Item> for Either<A, B>where A: Sink<Item>, B: Sink<Item, Error = A::Error>,
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