pub enum ErrorResponse {
Show 13 variants BadRequest(String), Unauthorized(String), NotFound(String), RequestTimeout(String), Conflict(String), PreconditionFailed(String), UnprocessableEntity(String), NoResponse(String), ClientClosedRequest(String), InternalServerError(String), NotImplemented(String), ServiceUnavailable(String), NetworkAuthenticationRequired(String),
}
Expand description

Enumeration containing many kinds of error responses to a REST request that was received. All of these responses should contain an embedded JSON in String format. These error responses are modelled after HTTP response codes.

Variants

BadRequest(String)

400 Bad Request

Unauthorized(String)

401 Unauthorized

NotFound(String)

404 Not Found

RequestTimeout(String)

408 Request Timeout

Conflict(String)

409 Conflict

PreconditionFailed(String)

412 Precondition Failed

UnprocessableEntity(String)

422 Unprocessable Entity

NoResponse(String)

444 No Response

ClientClosedRequest(String)

499 Client Closed Request

InternalServerError(String)

500 Internal Server Error

NotImplemented(String)

501 Not Implemented

ServiceUnavailable(String)

503 Service Unavailable

NetworkAuthenticationRequired(String)

511 Network Authentication Required

Implementations

Actual internal conversion function for generating an error Response from a gRPC Status. The Status message will be converted into a JSON object containing a single "message" field, which will be the response body.

Panics

This function will panic if using an unhandled status code or if the status code is “Ok”, in which case it should have been a successful response instead.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Create the responses type, which is a list of responses that can be rendered in openapi.json format. Read more
Returns Ok if a Response could be generated successfully. Otherwise, returns an Err with a failing Status. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts self into a collection.
Wrap the input message T in a tonic::Request
Convert self to an expression for Diesel’s query builder. Read more
Convert &self to an expression for Diesel’s query builder. Read more
Create the responses type, which is a list of responses that can be rendered in openapi.json format. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more