Skip to main content

IntoResponse

Trait IntoResponse 

Source
pub trait IntoResponse {
    // Required method
    fn into_response(self) -> Response<BoxBody>;
}
Expand description

Trait for types that can be converted into an HTTP response.

Required Methods§

Source

fn into_response(self) -> Response<BoxBody>

Convert this value into an HTTP response.

Implementations on Foreign Types§

Source§

impl IntoResponse for &'static str

Source§

impl IntoResponse for Infallible

Source§

impl IntoResponse for String

Source§

impl IntoResponse for Bytes

Source§

impl IntoResponse for Response<BoxBody>

Source§

impl IntoResponse for StatusCode

Source§

impl<T: IntoResponse> IntoResponse for (StatusCode, T)

Source§

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

Implementors§

Source§

impl IntoResponse for JsonError

Source§

impl<S> IntoResponse for SseResponse<S>
where S: Stream<Item = SseEvent> + Send + 'static,

Source§

impl<T, Formats> IntoResponse for NegotiatedResponse<T, Formats>
where Formats: NegotiateFormats<T>,

Source§

impl<T: Serialize> IntoResponse for Json<T>