pub trait Diagnostic: Error {
// Provided methods
fn oopsie_backtrace(&self) -> Option<&Backtrace> { ... }
fn oopsie_spantrace(&self) -> Option<&SpanTrace> { ... }
fn oopsie_location(&self) -> Option<&'static Location<'static>> { ... }
fn oopsie_error_code(&self) -> Option<ErrorCode> { ... }
fn oopsie_help_text(&self) -> Option<HelpText> { ... }
fn oopsie_exit_code(&self) -> Option<NonZeroU8> { ... }
}Expand description
Trait for errors that expose diagnostic data.
Always implemented by #[derive(Oopsie)]. Provides a stable mechanism
for extracting backtraces, span traces, error codes, and help text
without relying on the unstable Provide/Request API.
Provided Methods§
Sourcefn oopsie_backtrace(&self) -> Option<&Backtrace>
fn oopsie_backtrace(&self) -> Option<&Backtrace>
Returns the backtrace captured when this error was created.
Sourcefn oopsie_spantrace(&self) -> Option<&SpanTrace>
fn oopsie_spantrace(&self) -> Option<&SpanTrace>
Returns the span trace captured when this error was created.
Sourcefn oopsie_location(&self) -> Option<&'static Location<'static>>
fn oopsie_location(&self) -> Option<&'static Location<'static>>
Returns the caller location captured when this error was created.
Sourcefn oopsie_error_code(&self) -> Option<ErrorCode>
fn oopsie_error_code(&self) -> Option<ErrorCode>
Returns the error code associated with this error.
Sourcefn oopsie_help_text(&self) -> Option<HelpText>
fn oopsie_help_text(&self) -> Option<HelpText>
Returns the help text associated with this error.
Sourcefn oopsie_exit_code(&self) -> Option<NonZeroU8>
fn oopsie_exit_code(&self) -> Option<NonZeroU8>
Returns the process exit code this error should terminate with.
Honored by Report’s Termination impl on
stable. NonZeroU8 is what ExitCode::from
accepts portably, and zero would denote success on a path that is, by
construction, a failure.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".