Skip to main content

Either

Struct Either 

Source
pub struct Either<L, R> { /* private fields */ }

Implementations§

Source§

impl<L, R> Either<L, R>

Source

pub const fn left(inner: L) -> Self

Source

pub const fn right(inner: R) -> Self

Source

pub fn into_left(self) -> Result<L, Self>

Source

pub fn into_right(self) -> Result<R, Self>

Source§

impl<L> Either<L, L>

Source

pub fn into_inner(self) -> L

Trait Implementations§

Source§

impl<L, R> Body for Either<L, R>
where L: Body, R: Body<Data = L::Data>, R::Error: From<L::Error>,

Source§

type Data = <L as Body>::Data

The payload data type yielded by Frame::Data variants.
Source§

type Error = <R as Body>::Error

The error type that can occur while producing frames.
Source§

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

Attempt to pull the next frame from the body. Read more
Source§

fn is_end_stream(&self) -> bool

Indicates whether the body has been fully consumed. Read more
Source§

fn size_hint(&self) -> SizeHint

Returns a hint about the total size of the remaining Frame::Data payload. Read more
Source§

impl<'__pin, L, R> Unpin for Either<L, R>
where PinnedFieldsOf<__Origin<'__pin, L, R>>: Unpin,

Auto Trait Implementations§

§

impl<L, R> Freeze for Either<L, R>
where L: Freeze, R: Freeze,

§

impl<L, R> RefUnwindSafe for Either<L, R>

§

impl<L, R> Send for Either<L, R>
where L: Send, R: Send,

§

impl<L, R> Sync for Either<L, R>
where L: Sync, R: Sync,

§

impl<L, R> UnsafeUnpin for Either<L, R>
where L: UnsafeUnpin, R: UnsafeUnpin,

§

impl<L, R> UnwindSafe for Either<L, R>
where L: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<B> BodyExt for B
where B: Body,

Source§

fn frame(&mut self) -> FrameFuture<'_, Self>
where Self: Unpin,

Source§

fn data(&mut self) -> DataFuture<'_, Self>
where Self: Unpin,

Source§

fn chain<B>(self, other: B) -> ChainBody<Self, B>
where B: Body<Data = Self::Data>, Self: Sized, Self::Error: From<B::Error>,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.