Skip to main content

AuthErrorKind

Trait AuthErrorKind 

Source
pub trait AuthErrorKind: Error + Diagnostic {
    // Required method
    fn error_code(&self) -> &'static str;

    // Provided method
    fn payload(&self) -> Map<String, Value> { ... }
}
Expand description

Behaviour shared by every concrete error wrapped in an AuthError variant.

Implemented by the per-error structs so each owns its FFI code and any structured payload; AuthError dispatches to it via AuthError::kind.

Required Methods§

Source

fn error_code(&self) -> &'static str

Stable machine-readable identifier surfaced across FFI boundaries (e.g. JS Error.code). Named error_code to avoid colliding with miette::Diagnostic::code, inherited via the Diagnostic supertrait.

Provided Methods§

Source

fn payload(&self) -> Map<String, Value>

Extra structured fields for the FFI/TS failure payload, beyond the type/message/help/url the enum emits generically. None by default.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§