pub trait HttpError: Display + Debug + Send + 'static + Sized {
type Body: Into<ResponseBody>;
fn into_response(self, request: &Request<()>) -> Response<Self::Body>;
}
Expand description
A trait representing error values to be converted into an HTTP response.
The role of this trait is similar to IntoResponse
, but there are the following
differences:
HttpError::into_response
is infallible.- The error values are stored as an object.
Required Associated Types
type Body: Into<ResponseBody>
Required Methods
Implementations on Foreign Types
sourceimpl HttpError for StatusCode
impl HttpError for StatusCode
sourceimpl HttpError for Error
impl HttpError for Error
The implementation of HttpError
for the generic error provided by failure
.