Trait monoio_http::common::body::Body

source ·
pub trait Body {
    type Data: IoBuf;
    type Error;
    type DataFuture<'a>: Future<Output = Option<Result<Self::Data, Self::Error>>>
       where Self: 'a;

    // Required methods
    fn next_data(&mut self) -> Self::DataFuture<'_>;
    fn stream_hint(&self) -> StreamHint;
}

Required Associated Types§

source

type Data: IoBuf

source

type Error

source

type DataFuture<'a>: Future<Output = Option<Result<Self::Data, Self::Error>>> where Self: 'a

Required Methods§

source

fn next_data(&mut self) -> Self::DataFuture<'_>

source

fn stream_hint(&self) -> StreamHint

Implementors§

source§

impl Body for HttpBody

§

type Data = Bytes

§

type Error = HttpError

§

type DataFuture<'a> = impl Future<Output = Option<Result<<HttpBody as Body>::Data, <HttpBody as Body>::Error>>> + 'a where Self: 'a

source§

impl Body for FramedPayloadRecvr

§

type Data = Bytes

§

type Error = DecodeError

§

type DataFuture<'a> = impl Future<Output = Option<Result<<FramedPayloadRecvr as Body>::Data, <FramedPayloadRecvr as Body>::Error>>> + 'a where Self: 'a

source§

impl Body for RecvStream

§

type Data = Bytes

§

type Error = Error

§

type DataFuture<'a> = impl Future<Output = Option<Result<<RecvStream as Body>::Data, <RecvStream as Body>::Error>>> + 'a where Self: 'a

source§

impl<D: IoBuf, E> Body for Payload<D, E>

§

type Data = D

§

type Error = E

§

type DataFuture<'a> = impl Future<Output = Option<Result<D, E>>> + 'a where Self: 'a

source§

impl<T> Body for FramedPayload<T>where T: BorrowFramedRead, T::IO: AsyncReadRent,

§

type Data = Bytes

§

type Error = DecodeError

§

type DataFuture<'a> = impl Future<Output = Option<Result<<FramedPayload<T> as Body>::Data, <FramedPayload<T> as Body>::Error>>> + 'a where Self: 'a