pub struct ErrorResponse {
pub status: StatusCode,
pub problems: Vec<Problem>,
}
Expand description
JSON payload for an error response.
Fields§
§status: StatusCode
Status code of the response
problems: Vec<Problem>
The list of problems to relay to the caller.
Implementations§
Source§impl ErrorResponse
impl ErrorResponse
Sourcepub fn internal_server_error() -> Self
pub fn internal_server_error() -> Self
Convenience function for an internal server error response.
Sourcepub fn unauthenticated() -> Self
pub fn unauthenticated() -> Self
Convenience function for an unauthenticated response.
Sourcepub fn basic_bad_request<S1: ToString, S2: ToString>(
pointer: S1,
detail: S2,
) -> Self
pub fn basic_bad_request<S1: ToString, S2: ToString>( pointer: S1, detail: S2, ) -> Self
Convenience function for a bad request response, with a single problem to present to the caller.
Sourcepub fn bad_request(problems: Vec<Problem>) -> Self
pub fn bad_request(problems: Vec<Problem>) -> Self
Convenience function for a bad request response, with a set of problems to present to the caller.
Sourcepub fn unprocessable_entity() -> Self
pub fn unprocessable_entity() -> Self
Convenience function for when part of the request was not able to be processed.
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<'de> Deserialize<'de> for ErrorResponse
impl<'de> Deserialize<'de> for ErrorResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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