ErrorAdapter

Trait ErrorAdapter 

Source
pub trait ErrorAdapter {
    // Required methods
    fn name(&self) -> &'static str;
    fn dependencies(&self) -> Vec<Dependency>;
    fn result_type(&self, inner: &str) -> String;
    fn imports(&self) -> Vec<ImportSpec>;
    fn wrap_error(&self, message: &str) -> Option<String>;

    // Provided method
    fn unit_result(&self) -> String { ... }
}
Expand description

Trait for error handling adapters.

Implement this trait to support a specific error handling library.

Required Methods§

Source

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

Adapter name for identification.

Source

fn dependencies(&self) -> Vec<Dependency>

Dependencies required by this error adapter.

Source

fn result_type(&self, inner: &str) -> String

The Result type alias or full type (e.g., “eyre::Result<()>”).

Source

fn imports(&self) -> Vec<ImportSpec>

Imports needed for error handling.

Source

fn wrap_error(&self, message: &str) -> Option<String>

The error conversion expression (e.g., .wrap_err("message")).

Provided Methods§

Source

fn unit_result(&self) -> String

The unit Result type (e.g., “eyre::Result<()>”).

Implementors§