pub trait ErrorDiagnostic: StdError + 'static {
type Kind: ResultKind;
// Required method
fn kind(&self) -> Self::Kind;
// Provided methods
fn tag(&self) -> Option<&Bytes> { ... }
fn service(&self) -> Option<&'static str> { ... }
fn backtrace(&self) -> Option<&Backtrace> { ... }
fn chain(self) -> ErrorChain<Self::Kind>
where Self: Sized { ... }
}Expand description
Provides diagnostic information for errors.
It enables classification, service attribution, and debugging context.
Required Associated Types§
type Kind: ResultKind
Required Methods§
Provided Methods§
Sourcefn tag(&self) -> Option<&Bytes>
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.
Sourcefn service(&self) -> Option<&'static str>
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.
Sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Returns a backtrace for debugging purposes, if available.