[][src]Trait izanami_http::body::HttpBody

pub trait HttpBody {
    type Data: Buf;
    type Error;
    fn poll_data(&mut self) -> Poll<Option<Self::Data>, Self::Error>;

    fn size_hint(&self) -> SizeHint { ... }
fn poll_trailers(&mut self) -> Poll<Option<HeaderMap>, Self::Error> { ... }
fn is_end_stream(&self) -> bool { ... }
fn content_length(&self) -> Option<u64> { ... } }

A trait that abstracts HTTP request/response bodies.

Associated Types

type Data: Buf

The type of bytes generated by this body.

type Error

The error type that will be returned from this body.

Loading content...

Required methods

fn poll_data(&mut self) -> Poll<Option<Self::Data>, Self::Error>

Polls the next data of this body.

Loading content...

Provided methods

fn size_hint(&self) -> SizeHint

Returns the hint of remaining length of data.

fn poll_trailers(&mut self) -> Poll<Option<HeaderMap>, Self::Error>

Polls the trailing header map of this body.

fn is_end_stream(&self) -> bool

Returns whether the body has been completed emitting all chunks and trailer headers.

It is possible that this method returns false even if the body has incomplete chunks or trailers.

fn content_length(&self) -> Option<u64>

Returns the length of total bytes contained in this body.

Loading content...

Implementors

impl HttpBody for Body[src]

type Data = Data

type Error = Error

impl<T> HttpBody for NoUpgrade<T> where
    T: HttpBody
[src]

type Data = T::Data

type Error = T::Error

impl<T, U> HttpBody for MaybeUpgrade<T, U> where
    T: HttpBody
[src]

type Data = T::Data

type Error = T::Error

impl<T: BufStream> HttpBody for T[src]

type Data = T::Item

type Error = T::Error

fn content_length(&self) -> Option<u64>[src]

Loading content...