DefaultError

Trait DefaultError 

Source
pub trait DefaultError {
    // Required method
    fn from_anyhow(err: Error) -> Self;
}
Expand description

Extension trait to allow capturing errors into a “default” bucket.

This is useful for collecting errors that you want to report on but don’t need to match on. You can use this with a catch-all enum variant that contains either contains anyhow::Error or Box<dyn Error + Send + Sync + 'static>.

Any errors that don’t match the primary error type will be captured in the default error variant.

Required Methods§

Source

fn from_anyhow(err: Error) -> Self

Construct an error variant from the given 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§