pub enum Either<A, B> {
Left(A),
Right(B),
}
Expand description
Combines two different futures, streams, or sinks having the same associated types into a single
type.
Second branch of the type
Return true if the value is the Left variant.
Return true if the value is the Right variant.
Convert the left side of Either<L, R> to an Option<L>.
Convert the right side of Either<L, R> to an Option<R>.
Convert &Either<L, R> to Either<&L, &R>.
Convert &mut Either<L, R> to Either<&mut L, &mut R>.
Factor out a homogeneous type from an either of pairs.
Here, the homogeneous type is the first element of the pairs.
Factor out a homogeneous type from an either of pairs.
Here, the homogeneous type is the second element of the pairs.
Extract the value of an either over two equivalent types.
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Either implements Error if both A and B implement it.
The lower-level source of this error, if any. Read more
🔬 This is a nightly-only experimental API. (backtrace)
Returns a stack backtrace, if available, of where this error occurred. Read more
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
👎 Deprecated since 1.33.0:
replaced by Error::source, which can support downcasting
The type of value produced on completion.
Attempt to resolve the future to a final value, registering
the current task for wakeup if the value is not yet available. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >=
operator. Read more
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
🔬 This is a nightly-only experimental API. (into_future)
The output that the future will produce on completion.
🔬 This is a nightly-only experimental API. (into_future)
Which kind of future are we turning this into?
🔬 This is a nightly-only experimental API. (into_future)
Creates a future from a value.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into)
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
The type of successful values yielded by this future
The type of failures yielded by this future
Poll this TryFuture as if it were a Future. Read more
The type returned in the event of a conversion error.