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
whereT: IntoResponse
. - as the
Ok
variant of theResult
returned 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.