#[non_exhaustive]pub struct ProblemDetails { /* private fields */ }Expand description
Corps Problem Details (RFC 9457) porté par CarbonFrError::Api.
Champs privés + accesseurs (plutôt que publics comme les DTO de core,
ADR-0030 §3) : #[non_exhaustive] sur une struct à champs publics
interdirait la construction par littéral qu’il protège, donc les deux
doctrines ne se combinent pas — ici on choisit l’ouverture par accesseurs.
code est l’ancrage machine stable à matcher en priorité (detail est
un message humain, jamais stable) — voir CarbonFrError::code.
Implementations§
Source§impl ProblemDetails
impl ProblemDetails
Sourcepub fn problem_type(&self) -> Option<&str>
pub fn problem_type(&self) -> Option<&str>
URI du type de problème (RFC 9457 §4.2.1) — about:blank aujourd’hui
sur toute l’API (status + code suffisent).
Sourcepub fn status(&self) -> Option<u16>
pub fn status(&self) -> Option<u16>
Code de statut HTTP, répété dans le corps (RFC 9457 §3.1.2).
Trait Implementations§
Source§impl Clone for ProblemDetails
impl Clone for ProblemDetails
Source§impl Debug for ProblemDetails
impl Debug for ProblemDetails
Source§impl Default for ProblemDetails
impl Default 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