pub trait BodyExt: Body {
    // Provided methods
    fn frame(&mut self) -> Frame<'_, Self> 
       where Self: Unpin { ... }
    fn map_frame<F, B>(self, f: F) -> MapFrame<Self, F>
       where Self: Sized,
             F: FnMut(Frame<Self::Data>) -> Frame<B>,
             B: Buf { ... }
    fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
       where Self: Sized,
             F: FnMut(Self::Error) -> E { ... }
    fn boxed(self) -> BoxBody<Self::Data, Self::Error>
       where Self: Sized + Send + Sync + 'static { ... }
    fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>
       where Self: Sized + Send + 'static { ... }
    fn collect(self) -> Collect<Self> 
       where Self: Sized { ... }
}
Expand description

An extension trait for http_body::Body adding various combinators and adapters

Provided Methods§

source

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

Returns a future that resolves to the next Frame, if any.

source

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.

source

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.

source

fn boxed(self) -> BoxBody<Self::Data, Self::Error>where Self: Sized + Send + Sync + 'static,

Turn this body into a boxed trait object.

source

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.

source

fn collect(self) -> Collect<Self> where Self: Sized,

Turn this body into Collected body which will collect all the DATA frames and trailers.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> BodyExt for Twhere T: Body + ?Sized,