pub trait IntoResponse {
    // Required method
    fn into_response(
        self
    ) -> Pin<Box<dyn Future<Output = Response<Body>> + Send>>;
}
Expand description

Trait for generating responses

Types that implement this trait can be used as return types for handler functions.

Required Methods§

source

fn into_response(self) -> Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Transform into a Response Future

Implementations on Foreign Types§

source§

impl IntoResponse for &[u8]

source§

fn into_response(self) -> Pin<Box<dyn Future<Output = Response<Body>> + Send>>

source§

impl IntoResponse for (StatusCode, Value)

source§

fn into_response(self) -> Pin<Box<dyn Future<Output = Response<Body>> + Send>>

source§

impl IntoResponse for (StatusCode, &str)

source§

fn into_response(self) -> Pin<Box<dyn Future<Output = Response<Body>> + Send>>

source§

impl IntoResponse for Value

source§

fn into_response(self) -> Pin<Box<dyn Future<Output = Response<Body>> + Send>>

source§

impl IntoResponse for &str

source§

fn into_response(self) -> Pin<Box<dyn Future<Output = Response<Body>> + Send>>

source§

impl IntoResponse for (StatusCode, Vec<u8>)

source§

fn into_response(self) -> Pin<Box<dyn Future<Output = Response<Body>> + Send>>

source§

impl IntoResponse for (StatusCode, &[u8])

source§

fn into_response(self) -> Pin<Box<dyn Future<Output = Response<Body>> + Send>>

source§

impl IntoResponse for Vec<u8>

source§

fn into_response(self) -> Pin<Box<dyn Future<Output = Response<Body>> + Send>>

source§

impl IntoResponse for (StatusCode, String)

source§

fn into_response(self) -> Pin<Box<dyn Future<Output = Response<Body>> + Send>>

source§

impl IntoResponse for String

source§

fn into_response(self) -> Pin<Box<dyn Future<Output = Response<Body>> + Send>>

Implementors§

source§

impl<B> IntoResponse for Response<B>where B: ConvertBody + Send + 'static,