pub enum Either<A, B> {
Either(A),
Or(B),
}Expand description
Intermediate container for 2 variants.
Used e.g. to propagate 2 error variants to a higher level error enum while at the same time hide the rest of the higher level variants to the implementation using Either.
Variants§
Trait Implementations§
Source§impl<E> From<Either<HeaderParseError, E>> for ReadStreamError<E>
impl<E> From<Either<HeaderParseError, E>> for ReadStreamError<E>
Source§fn from(value: Either<HeaderParseError, E>) -> Self
fn from(value: Either<HeaderParseError, E>) -> Self
Converts to this type from the input type.
Source§impl<B> From<HeaderParseError> for Either<HeaderParseError, B>
impl<B> From<HeaderParseError> for Either<HeaderParseError, B>
Source§fn from(value: HeaderParseError) -> Self
fn from(value: HeaderParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<A, B> Freeze for Either<A, B>
impl<A, B> RefUnwindSafe for Either<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Either<A, B>
impl<A, B> Sync for Either<A, B>
impl<A, B> Unpin for Either<A, B>
impl<A, B> UnwindSafe for Either<A, B>where
A: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.