Trait GenerateImplicitData

Source
pub trait GenerateImplicitData {
    // Required method
    fn generate() -> Self;

    // Provided methods
    fn generate_with_source(_source: &dyn Error) -> Self
       where Self: Sized { ... }
    fn generate_with_context(context: &HashMap<String, String>) -> Self
       where Self: Sized { ... }
}
Expand description

Trait for generating implicit data automatically

This replaces snafu’s GenerateImplicitData trait with our own implementation

Required Methods§

Source

fn generate() -> Self

Generate the implicit data

Provided Methods§

Source

fn generate_with_source(_source: &dyn Error) -> Self
where Self: Sized,

Generate implicit data with access to a source error

Default implementation ignores the source and calls generate()

Source

fn generate_with_context(context: &HashMap<String, String>) -> Self
where Self: Sized,

Generate implicit data with custom context

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.

Implementations on Foreign Types§

Source§

impl GenerateImplicitData for Backtrace

Implementation of GenerateImplicitData for std::backtrace::Backtrace

Implementors§