Skip to main content

IntoResponse

Trait IntoResponse 

Source
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§

Source

fn into_response(self) -> Response

Build the response.

Provided Methods§

Source

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

Source§

impl IntoResponse for ()

Source§

impl IntoResponse for String

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.

Source§

impl<T: IntoResponse, E: IntoResponse> IntoResponse for Result<T, E>

Implementors§