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§
Sourcefn report(&self) -> Report<ReportHelper<'_>>
fn report(&self) -> Report<ReportHelper<'_>>
Return an object that displays the error and its causes
Implementations on Foreign Types§
Source§impl ErrorReport for dyn StdError + 'static
impl ErrorReport for dyn StdError + 'static
fn report(&self) -> Report<ReportHelper<'_>>
Source§impl ErrorReport for dyn StdError + Send + Sync
Implementation for anyhow::Error
, which derefs to dyn StdError
.
impl ErrorReport for dyn StdError + Send + Sync
Implementation for anyhow::Error
, which derefs to dyn StdError
.