pub trait IntoResponse {
// Required methods
fn openapi(registry: &mut Registry) -> Responses;
fn into_response(self) -> Response;
}Expand description
A type that is convertible to an HTTP response with OpenAPI description.
Most notably, this trait is implemented for
T: ToSchema + SchemaSerialize, returning a200 Okresponse withContent-Type: application/jsonResult<T, E>withT: IntoResponseandE: IntoResponse- The new-type structs in this module named after status codes (e.g.
Created)
Required Methods§
Sourcefn openapi(registry: &mut Registry) -> Responses
fn openapi(registry: &mut Registry) -> Responses
Describes the responses generated via the into_response function.
Sourcefn into_response(self) -> Response
fn into_response(self) -> Response
Converts this value into an axum response.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.