Trait ajars_actix_web::actix_web::ResponseError [−][src]
pub trait ResponseError: Debug + Display { fn status_code(&self) -> StatusCode { ... } fn error_response(&self) -> HttpResponse<AnyBody>ⓘ{ ... } }Notable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
Expand description
Errors that can generate responses.
Provided methods
fn status_code(&self) -> StatusCode
fn status_code(&self) -> StatusCode
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.
fn error_response(&self) -> HttpResponse<AnyBody>ⓘNotable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
fn error_response(&self) -> HttpResponse<AnyBody>ⓘNotable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
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
pub fn error_response(&self) -> HttpResponse<AnyBody>ⓘNotable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;
pub fn error_response(&self) -> HttpResponse<AnyBody>ⓘNotable traits for HttpResponse<AnyBody>
impl Future for HttpResponse<AnyBody> type Output = Result<Response<AnyBody>, Error>;