Trait viz::IntoResponse

source ·
pub trait IntoResponse: Sized {
    // Required method
    fn into_response(self) -> Response<Body>;

    // Provided method
    fn into_error(self) -> Error { ... }
}
Expand description

Trait implemented by types that can be converted to an HTTP Response.

Required Methods§

source

fn into_response(self) -> Response<Body>

Convert self to HTTP Response.

Provided Methods§

source

fn into_error(self) -> Error

Convert self to the Error.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl IntoResponse for &'static str

source§

impl IntoResponse for &'static [u8]

source§

impl IntoResponse for Infallible

source§

impl IntoResponse for ()

source§

impl IntoResponse for String

source§

impl IntoResponse for Vec<u8>

source§

impl IntoResponse for Error

source§

impl IntoResponse for Response<Body>

source§

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

source§

impl<T> IntoResponse for Option<T>
where T: IntoResponse,

source§

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

Implementors§