pavex::response

Trait IntoResponse

source
pub trait IntoResponse {
    // Required method
    fn into_response(self) -> Response;
}
Expand description

Convert a type into a Response.

Types that implement IntoResponse can be returned:

  • as the output type of an infallible route handler, e.g. fn handler() -> T where T: IntoResponse.
  • as the Ok variant of the Result returned by a fallible route handler, e.g. fn handler() -> Result<T, E> where T: IntoResponse.

Required Methods§

source

fn into_response(self) -> Response

Convert self into an HTTP response.

Implementations on Foreign Types§

source§

impl IntoResponse for Parts

source§

impl<B> IntoResponse for Response<B>
where B: Body<Data = Bytes> + Send + Sync + 'static, B::Error: Into<Box<dyn Error + Send + Sync>> + 'static,

Implementors§