Struct Collected

pub struct Collected<B> { /* private fields */ }

A collected body produced by BodyExt::collect which collects all the DATA frames and trailers.

Implementations

impl<B: Buf> Collected<B>

fn trailers(&self) -> Option<&HeaderMap>

If there is a trailers frame buffered, returns a reference to it.

Returns None if the body contained no trailers.

fn aggregate(self) -> impl Buf

Aggregate this buffered into a Buf.

fn to_bytes(self) -> Bytes

Convert this body into a Bytes.

Trait Implementations

impl<B> Default for Collected<B>

fn default() -> Self

impl<B> Unpin for Collected<B>

impl<B: Buf> Body for Collected<B>

type Data = B;
type Error = never;
fn poll_frame(self: Pin<&mut Self>, &mut Context<'_>) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>>

impl<B: Debug> Debug for Collected<B>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<B> Freeze for Collected<B> where BufList<B>: Freeze,

impl<B> RefUnwindSafe for Collected<B> where BufList<B>: RefUnwindSafe,

impl<B> Send for Collected<B> where BufList<B>: Send,

impl<B> Sync for Collected<B> where BufList<B>: Sync,

impl<B> UnsafeUnpin for Collected<B> where BufList<B>: UnsafeUnpin,

impl<B> UnwindSafe for Collected<B> where BufList<B>: UnwindSafe,

Blanket Implementations

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

fn type_id(&self) -> TypeId

impl<T> BodyExt for Collected<B> where T: Body + ?Sized,

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for Collected<B>

fn from(t: T) -> T

Returns the argument unchanged.

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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