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

Trait indicating that a type can be fallibly converted into a http::Response<Bytes>.

This is a separate trait (rather than using TryFrom/TryInto) because it may need to be async.

Required Methods§

source

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

Performs the conversion.

Implementations on Foreign Types§

source§

impl IntoHttpResponse for Value

source§

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

source§

impl IntoHttpResponse for Vec<u8>

source§

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

source§

impl IntoHttpResponse for Response<Vec<u8>>

source§

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

source§

impl IntoHttpResponse for Response<Bytes>

source§

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

source§

impl IntoHttpResponse for Response

source§

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

Implementors§