Enum http_body_util::Either
source · [−]pub enum Either<L, R> {
Left(L),
Right(R),
}
Expand description
Sum type with two cases: Left
and Right
, used if a body can be one of
two distinct types.
Variants
Left(L)
A value of type L
Right(R)
A value of type R
Implementations
sourceimpl<L> Either<L, L>
impl<L> Either<L, L>
sourcepub fn into_inner(self) -> L
pub fn into_inner(self) -> L
Convert Either
into the inner type, if both Left
and Right
are
of the same type.
Trait Implementations
sourceimpl<L, R, Data> Body for Either<L, R>where
L: Body<Data = Data>,
R: Body<Data = Data>,
L::Error: Into<Box<dyn Error + Send + Sync>>,
R::Error: Into<Box<dyn Error + Send + Sync>>,
Data: Buf,
impl<L, R, Data> Body for Either<L, R>where
L: Body<Data = Data>,
R: Body<Data = Data>,
L::Error: Into<Box<dyn Error + Send + Sync>>,
R::Error: Into<Box<dyn Error + Send + Sync>>,
Data: Buf,
type Data = Data
type Data = Data
Values yielded by the
Body
.sourcefn poll_frame(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>>
fn poll_frame(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>>
Attempt to pull out the next data buffer of this stream.
sourcefn is_end_stream(&self) -> bool
fn is_end_stream(&self) -> bool
Returns
true
when the end of stream has been reached. Read moreimpl<L: Copy, R: Copy> Copy for Either<L, R>
impl<'__pin, L, R> Unpin for Either<L, R>where
__Origin<'__pin, L, R>: Unpin,
Auto Trait Implementations
impl<L, R> RefUnwindSafe for Either<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
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> UnwindSafe for Either<L, R>where
L: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BodyExt for Twhere
T: Body + ?Sized,
impl<T> BodyExt for Twhere
T: Body + ?Sized,
sourcefn frame(&mut self) -> Frame<'_, Self>ⓘNotable traits for Frame<'a, T>impl<'a, T: Body + Unpin + ?Sized> Future for Frame<'a, T> type Output = Option<Result<Frame<T::Data>, T::Error>>;
where
Self: Unpin,
fn frame(&mut self) -> Frame<'_, Self>ⓘNotable traits for Frame<'a, T>impl<'a, T: Body + Unpin + ?Sized> Future for Frame<'a, T> type Output = Option<Result<Frame<T::Data>, T::Error>>;
where
Self: Unpin,
Returns a future that resolves to the next
Frame
, if any.sourcefn map_frame<F, B>(self, f: F) -> MapFrame<Self, F>where
Self: Sized,
F: FnMut(Frame<Self::Data>) -> Frame<B>,
B: Buf,
fn map_frame<F, B>(self, f: F) -> MapFrame<Self, F>where
Self: Sized,
F: FnMut(Frame<Self::Data>) -> Frame<B>,
B: Buf,
Maps this body’s frame to a different kind.
sourcefn map_err<F, E>(self, f: F) -> MapErr<Self, F>where
Self: Sized,
F: FnMut(Self::Error) -> E,
fn map_err<F, E>(self, f: F) -> MapErr<Self, F>where
Self: Sized,
F: FnMut(Self::Error) -> E,
Maps this body’s error value to a different value.
sourcefn boxed(self) -> BoxBody<Self::Data, Self::Error>where
Self: Sized + Send + Sync + 'static,
fn boxed(self) -> BoxBody<Self::Data, Self::Error>where
Self: Sized + Send + Sync + 'static,
Turn this body into a boxed trait object.
sourcefn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>where
Self: Sized + Send + 'static,
fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>where
Self: Sized + Send + 'static,
Turn this body into a boxed trait object that is !Sync.
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more