Skip to main content

ErrorReport

Trait ErrorReport 

Source
pub trait ErrorReport:
    Sealed
    + StdError
    + 'static {
    // Required method
    fn report(&self) -> Report<ReportHelper<'_>>;
}
Expand description

Extension trait providing .report() method on concrete errors

This is implemented for types that directly implement std::error::Error + 'static.

For types like anyhow::Error that impl Deref<Target = dyn Error...>, you can use tor_error::Report(err) directly, but you can also call .report() via the impl of this trait for dyn Error.

Required Methods§

Source

fn report(&self) -> Report<ReportHelper<'_>>

Return an object that displays the error and its causes

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ErrorReport for dyn StdError + 'static

Source§

impl ErrorReport for dyn StdError + Send + Sync

Implementation for anyhow::Error, which derefs to dyn StdError.

Implementors§

Source§

impl<E: StdError + Sized + 'static> ErrorReport for E