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() -> TwhereT: IntoResponse. - as the
Okvariant of theResultreturned by a fallible route handler, e.g.fn handler() -> Result<T, E>whereT: IntoResponse.
Required Methods§
Sourcefn into_response(self) -> Response
fn into_response(self) -> Response
Convert self into an HTTP response.