pub trait ApiErrorProblem {
// Required method
fn problem(&self) -> Option<ProblemDetails>;
}Expand description
Implemented by every generated operation error type, so code generic over operations can read the RFC 9457 members of whichever documented error body a failure carried, without naming each status’s body type.
Every shape implements it: the multi-status enum answers from the variant’s body (and None
for a documented bodyless status), the single-body newtype from its one body, and the
uninhabited Infallible shape never answers. A body read as raw bytes (bytes::Bytes) answers
None. Error::problem is the reader to call; this trait is its bound.
Required Methods§
Sourcefn problem(&self) -> Option<ProblemDetails>
fn problem(&self) -> Option<ProblemDetails>
The problem-details members of the documented body this value carries, if its status documents one that serializes to a JSON object.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".