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§
Sourcefn dependencies(&self) -> Vec<Dependency>
fn dependencies(&self) -> Vec<Dependency>
Dependencies required by this error adapter.
Sourcefn result_type(&self, inner: &str) -> String
fn result_type(&self, inner: &str) -> String
The Result type alias or full type (e.g., “eyre::Result<()>”).
Sourcefn imports(&self) -> Vec<ImportSpec>
fn imports(&self) -> Vec<ImportSpec>
Imports needed for error handling.
Sourcefn wrap_error(&self, message: &str) -> Option<String>
fn wrap_error(&self, message: &str) -> Option<String>
The error conversion expression (e.g., .wrap_err("message")).
Provided Methods§
Sourcefn unit_result(&self) -> String
fn unit_result(&self) -> String
The unit Result type (e.g., “eyre::Result<()>”).