Skip to main content

StructuredError

Trait StructuredError 

Source
pub trait StructuredError: Display + Serialize {
    // Required methods
    fn exit_code(&self) -> ExitCode;
    fn suggestion(&self) -> &str;
}
Expand description

Trait for domain-specific errors with structured output support.

Required Methods§

Source

fn exit_code(&self) -> ExitCode

Return the exit code for this error.

Source

fn suggestion(&self) -> &str

Return a human-readable suggestion for resolving this error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§