Skip to main content

ErrorDiagnostic

Trait ErrorDiagnostic 

Source
pub trait ErrorDiagnostic: StdError + 'static {
    // Required method
    fn signature(&self) -> &'static str;

    // Provided methods
    fn tag(&self) -> Option<&Bytes> { ... }
    fn service(&self) -> Option<&'static str> { ... }
    fn backtrace(&self) -> Option<&Backtrace> { ... }
}
Expand description

Provides diagnostic information for errors.

It enables classification, service attribution, and debugging context.

Required Methods§

Source

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

Returns a stable identifier for the specific error classification.

It is used for logging, metrics, and diagnostics.

Provided Methods§

Source

fn tag(&self) -> Option<&Bytes>

Returns an optional tag associated with this error.

The tag is user-defined and can be used for additional classification or correlation.

Source

fn service(&self) -> Option<&'static str>

Returns the name of the responsible service, if applicable.

Used to identify upstream or internal service ownership for diagnostics.

Source

fn backtrace(&self) -> Option<&Backtrace>

Returns a backtrace for debugging purposes, if available.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ErrorDiagnostic for Error

Source§

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

Source§

impl ErrorDiagnostic for Infallible

Source§

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

Implementors§