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§
sourcefn into_response(self) -> Response<Body>
fn into_response(self) -> Response<Body>
Convert self to HTTP Response
.
Provided Methods§
sourcefn into_error(self) -> Error
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
impl IntoResponse for &'static str
fn into_response(self) -> Response<Body>
source§impl IntoResponse for &'static [u8]
impl IntoResponse for &'static [u8]
fn into_response(self) -> Response<Body>
source§impl IntoResponse for Infallible
impl IntoResponse for Infallible
fn into_response(self) -> Response<Body>
source§impl IntoResponse for ()
impl IntoResponse for ()
fn into_response(self) -> Response<Body>
source§impl IntoResponse for String
impl IntoResponse for String
fn into_response(self) -> Response<Body>
source§impl IntoResponse for Vec<u8>
impl IntoResponse for Vec<u8>
fn into_response(self) -> Response<Body>
source§impl IntoResponse for Error
impl IntoResponse for Error
fn into_response(self) -> Response<Body>
source§impl IntoResponse for Response<Body>
impl IntoResponse for Response<Body>
fn into_response(self) -> Response<Body>
source§impl<T> IntoResponse for (StatusCode, T)where
T: IntoResponse,
impl<T> IntoResponse for (StatusCode, T)where
T: IntoResponse,
fn into_response(self) -> Response<Body>
source§impl<T> IntoResponse for Option<T>where
T: IntoResponse,
impl<T> IntoResponse for Option<T>where
T: IntoResponse,
fn into_response(self) -> Response<Body>
source§impl<T, E> IntoResponse for Result<T, E>where
T: IntoResponse,
E: IntoResponse,
impl<T, E> IntoResponse for Result<T, E>where
T: IntoResponse,
E: IntoResponse,
fn into_response(self) -> Response<Body>
Implementors§
impl IntoResponse for viz::Error
impl IntoResponse for viz::handlers::serve::Error
impl IntoResponse for CookiesError
impl IntoResponse for HeaderError
impl IntoResponse for viz::types::MultipartError
impl IntoResponse for ParamsError
impl IntoResponse for PayloadError
impl IntoResponse for WebSocketError
impl IntoResponse for Bytes
impl IntoResponse for StatusCode
impl IntoResponse for StateError
impl IntoResponse for WebSocket
impl<S> IntoResponse for Sse<S>
impl<T> IntoResponse for Compress<T>where
T: IntoResponse,
impl<T> IntoResponse for Json<T>where
T: Serialize,
Responds with JSON Data.