pub struct ProblemDetail {
pub error_type: String,
pub title: String,
pub status: u16,
pub detail: String,
pub instance: Option<String>,
pub code: ErrorCode,
pub retryable: bool,
pub details: HashMap<String, Value>,
}Expand description
RFC 9457 Problem Details — the single canonical error response envelope for transport error responses in rskit.
Serialises to:
{
"type": "https://rskit.dev/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "user '42' not found",
"code": "NOT_FOUND",
"retryable": false
}Fields§
§error_type: StringURI reference that identifies the problem type (RFC 9457 §3.1.1).
title: StringShort, human-readable summary of the problem type (RFC 9457 §3.1.2).
status: u16HTTP status code (RFC 9457 §3.1.3).
detail: StringHuman-readable explanation specific to this occurrence (RFC 9457 §3.1.4).
instance: Option<String>URI reference identifying this specific occurrence (RFC 9457 §3.1.5).
code: ErrorCodeMachine-readable error code (rskit extension).
retryable: boolWhether the operation that produced this error is safe to retry (rskit extension).
details: HashMap<String, Value>Arbitrary key-value pairs providing additional context (rskit extension).
Trait Implementations§
Source§impl Clone for ProblemDetail
impl Clone for ProblemDetail
Source§fn clone(&self) -> ProblemDetail
fn clone(&self) -> ProblemDetail
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ProblemDetail
impl Debug for ProblemDetail
Source§impl<'de> Deserialize<'de> for ProblemDetail
impl<'de> Deserialize<'de> for ProblemDetail
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
Source§impl From<&AppError> for ProblemDetail
impl From<&AppError> for ProblemDetail
Source§impl From<AppError> for ProblemDetail
impl From<AppError> for ProblemDetail
Auto Trait Implementations§
impl Freeze for ProblemDetail
impl RefUnwindSafe for ProblemDetail
impl Send for ProblemDetail
impl Sync for ProblemDetail
impl Unpin for ProblemDetail
impl UnsafeUnpin for ProblemDetail
impl UnwindSafe for ProblemDetail
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