logo
pub trait ResponseError: Debug + Display {
    fn status_code(&self) -> StatusCode { ... }
    fn error_response(&self) -> HttpResponse<BoxBody> { ... }
}
Expand description

Errors that can generate responses.

Provided Methods

Returns appropriate status code for error.

A 500 Internal Server Error is used by default. If error_response is also implemented and does not call self.status_code(), then this will not be used.

Creates full response for error.

By default, the generated response uses a 500 Internal Server Error status code, a Content-Type of text/plain, and the body is set to Self’s Display impl.

Implementations

Downcasts generic body to a specific type.

Downcasts a generic body to a mutable specific type.

Implementations on Foreign Types

Implementors