pub trait IntoResponse {
// Required method
fn into_response(self) -> Response;
// Provided method
fn describe(_op: &mut Operation, _registry: &mut SchemaRegistry) { ... }
}Expand description
Convert a value into an HTTP response.
Required Methods§
Sourcefn into_response(self) -> Response
fn into_response(self) -> Response
Build the response.
Provided Methods§
Sourcefn describe(_op: &mut Operation, _registry: &mut SchemaRegistry)
fn describe(_op: &mut Operation, _registry: &mut SchemaRegistry)
Document the responses this type can produce.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl IntoResponse for &'static str
impl IntoResponse for &'static str
fn into_response(self) -> Response
fn describe(op: &mut Operation, registry: &mut SchemaRegistry)
Source§impl IntoResponse for ()
impl IntoResponse for ()
fn into_response(self) -> Response
fn describe(op: &mut Operation, _: &mut SchemaRegistry)
Source§impl IntoResponse for String
impl IntoResponse for String
fn into_response(self) -> Response
fn describe(op: &mut Operation, registry: &mut SchemaRegistry)
Source§impl<R: IntoResponse> IntoResponse for (StatusCode, R)
Same as WithStatus: the runtime status is not documented. Use
MethodRouter::status for a
documented non-200 success status.
impl<R: IntoResponse> IntoResponse for (StatusCode, R)
Same as WithStatus: the runtime status is not documented. Use
MethodRouter::status for a
documented non-200 success status.