Trait Body

Source
pub trait Body {
    type Data: IoBuf;
    type Error;

    // Required methods
    fn next_data(
        &mut self,
    ) -> impl Future<Output = Option<Result<Self::Data, Self::Error>>>;
    fn stream_hint(&self) -> StreamHint;
}

Required Associated Types§

Required Methods§

Source

fn next_data( &mut self, ) -> impl Future<Output = Option<Result<Self::Data, Self::Error>>>

Source

fn stream_hint(&self) -> StreamHint

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Body for ()

Source§

type Data = Bytes

Source§

type Error = Infallible

Source§

async fn next_data(&mut self) -> Option<Result<Self::Data, Self::Error>>

Source§

fn stream_hint(&self) -> StreamHint

Source§

impl<T: Body> Body for &mut T

Source§

type Data = <T as Body>::Data

Source§

type Error = <T as Body>::Error

Source§

fn next_data( &mut self, ) -> impl Future<Output = Option<Result<Self::Data, Self::Error>>>

Source§

fn stream_hint(&self) -> StreamHint

Implementors§