pub struct ProblemDetails {
pub problem_type: String,
pub title: String,
pub status: u16,
pub detail: String,
pub instance: Option<String>,
pub errors: Vec<ValidationIssue>,
}Expand description
RFC 7807 Problem Details response.
Fields§
§problem_type: StringURI reference identifying the problem type.
title: StringShort summary.
status: u16HTTP status code.
detail: StringHuman-readable explanation.
instance: Option<String>URI of the request that caused the error.
errors: Vec<ValidationIssue>Detailed validation errors.
Implementations§
Source§impl ProblemDetails
impl ProblemDetails
Sourcepub fn validation_error(status: u16, issues: Vec<ValidationIssue>) -> Self
pub fn validation_error(status: u16, issues: Vec<ValidationIssue>) -> Self
Create a validation error response wrapping a list of ValidationIssues.
Sourcepub fn unsupported_media_type(detail: &str) -> Self
pub fn unsupported_media_type(detail: &str) -> Self
Create a 415 Unsupported Media Type response.
Sourcepub fn payload_too_large(detail: &str) -> Self
pub fn payload_too_large(detail: &str) -> Self
Create a 413 Payload Too Large response.
Trait Implementations§
Source§impl Clone for ProblemDetails
impl Clone for ProblemDetails
Source§fn clone(&self) -> ProblemDetails
fn clone(&self) -> ProblemDetails
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 ProblemDetails
impl Debug for ProblemDetails
Source§impl<'de> Deserialize<'de> for ProblemDetails
impl<'de> Deserialize<'de> for ProblemDetails
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 ProblemDetails
impl RefUnwindSafe for ProblemDetails
impl Send for ProblemDetails
impl Sync for ProblemDetails
impl Unpin for ProblemDetails
impl UnsafeUnpin for ProblemDetails
impl UnwindSafe for ProblemDetails
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