Trait viz_core::IntoResponse
source · pub trait IntoResponse: Sized {
// Required method
fn into_response(self) -> Response;
// 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
fn into_response(self) -> Response
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
source§impl IntoResponse for &'static [u8]
impl IntoResponse for &'static [u8]
fn into_response(self) -> Response
source§impl IntoResponse for Infallible
impl IntoResponse for Infallible
fn into_response(self) -> Response
source§impl IntoResponse for ()
impl IntoResponse for ()
fn into_response(self) -> Response
source§impl IntoResponse for String
impl IntoResponse for String
fn into_response(self) -> Response
source§impl IntoResponse for Vec<u8>
impl IntoResponse for Vec<u8>
fn into_response(self) -> Response
source§impl IntoResponse for Error
impl IntoResponse for Error
fn into_response(self) -> Response
source§impl<T> IntoResponse for (StatusCode, T)where
T: IntoResponse,
impl<T> IntoResponse for (StatusCode, T)where
T: IntoResponse,
fn into_response(self) -> Response
source§impl<T> IntoResponse for Option<T>where
T: IntoResponse,
impl<T> IntoResponse for Option<T>where
T: IntoResponse,
fn into_response(self) -> Response
Implementors§
impl IntoResponse for viz_core::Error
impl IntoResponse for CookiesError
Available on crate feature
cookie
only.impl IntoResponse for HeaderError
impl IntoResponse for MultipartError
Available on crate feature
multipart
only.impl IntoResponse for ParamsError
Available on crate feature
params
only.impl IntoResponse for PayloadError
impl IntoResponse for WebSocketError
Available on crate feature
websocket
only.impl IntoResponse for Bytes
impl IntoResponse for StatusCode
impl IntoResponse for StateError
Available on crate feature
state
only.impl IntoResponse for WebSocket
Available on crate feature
websocket
only.impl IntoResponse for Response
impl<S> IntoResponse for Sse<S>
Available on crate feature
sse
only.impl<T> IntoResponse for Json<T>where
T: Serialize,
Available on crate feature
json
only.Responds with JSON Data.
impl<T, E> IntoResponse for Result<T, E>where
T: IntoResponse,
E: IntoResponse,
impl<T: IntoResponse> IntoResponse for Compress<T>
Available on crate feature
compression
only.