Skip to main content

ResponseExt

Trait ResponseExt 

Source
pub trait ResponseExt {
    // Required methods
    fn collect_bytes(self) -> impl Future<Output = Result<Bytes, Error>> + Send;
    fn into_read(self) -> impl AsyncRead + Send + Unpin + 'static;
}
Expand description

Helper methods for http::Response.

Required Methods§

Source

fn collect_bytes(self) -> impl Future<Output = Result<Bytes, Error>> + Send

Collect the response body into a bytes::Bytes.

Source

fn into_read(self) -> impl AsyncRead + Send + Unpin + 'static

Convert the response body into an AsyncRead.

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.

Implementors§

Source§

impl<B> ResponseExt for Response<B>
where B: Body + Send + Unpin + 'static, B::Data: Send + 'static, B::Error: Error + Send + Sync + 'static,