pub trait ErrorDiagnostic: StdError + 'static {
type Kind: ResultKind;
// Required method
fn kind(&self) -> Self::Kind;
// Provided methods
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 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.