Skip to main content

IntoReportCompat

Trait IntoReportCompat 

Source
pub trait IntoReportCompat: Sized {
    type Ok;
    type Err;

    // Required method
    fn into_report(self) -> Result<Self::Ok, Report<Self::Err>>;
}
Expand description

Compatibility trait to convert from external libraries to Report.

Note: Most error libraries don’t implement Error, so it’s not possible to directly convert them to Report. However, error-stack supports converting errors generated from the anyhow or eyre crate via IntoReportCompat.

Required Associated Types§

Source

type Ok

Type of the Ok value in the Result.

Source

type Err

Type of the resulting Err variant wrapped inside a Report<E>.

Required Methods§

Source

fn into_report(self) -> Result<Self::Ok, Report<Self::Err>>

Converts the Err variant of the Result to a Report.

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<T> IntoReportCompat for Result<T, Error>

Available on crate feature anyhow only.
Source§

impl<T> IntoReportCompat for Result<T, Report>

Available on crate feature eyre only.

Implementors§