#[non_exhaustive]pub enum ErrorResponse {
BadRequest(BadRequest),
NotFound,
InternalServerError,
}
Expand description
An error response from a route handler.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BadRequest(BadRequest)
A bad request response.
NotFound
A not found response.
InternalServerError
An internal server error response.
Implementations§
Source§impl ErrorResponse
impl ErrorResponse
Sourcepub fn internal_server_error() -> Self
pub fn internal_server_error() -> Self
Create a new internal server error response.
Sourcepub fn bad_request<S1: ToString, S2: ToString>(pointer: S1, detail: S2) -> Self
pub fn bad_request<S1: ToString, S2: ToString>(pointer: S1, detail: S2) -> Self
Create a basic bad request.
Trait Implementations§
Source§impl Clone for ErrorResponse
impl Clone for ErrorResponse
Source§fn clone(&self) -> ErrorResponse
fn clone(&self) -> ErrorResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ErrorResponse
impl Debug for ErrorResponse
Source§impl From<BadRequest> for ErrorResponse
impl From<BadRequest> for ErrorResponse
Source§fn from(value: BadRequest) -> Self
fn from(value: BadRequest) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ErrorResponse
impl RefUnwindSafe for ErrorResponse
impl Send for ErrorResponse
impl Sync for ErrorResponse
impl Unpin for ErrorResponse
impl UnwindSafe for ErrorResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more