Trait tsukuyomi::HttpError

source ·
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

Required Methods

Consumes itself and creates an HTTP response from its value.

Implementations on Foreign Types

The implementation of HttpError for the standard I/O error.

The implementation of HttpError for the generic error provided by failure.

Implementors