Skip to main content

ResponseBody

Trait ResponseBody 

Source
pub trait ResponseBody:
    Send
    + Sync
    + Debug {
    type Error: Send + Sync + Debug + Into<Error>;
    type Bytes: AsRef<[u8]> + Into<Vec<u8>>;

    // Required method
    fn read_all<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Bytes, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Implemented by response bodies.

Required Associated Types§

Required Methods§

Source

fn read_all<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<Self::Bytes, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Consume the entire body and return all the bytes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> ResponseBody for T
where T: HttpBody + Send + Sync + Debug, T::Data: Send, T::Error: Debug + Send + Sync + Into<Error>,