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

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

Compatibility trait to convert from external libraries to Report.

Note: It’s not possible to implement IntoReport or Context on other error libraries’ types as both traits have blanket implementation relying on Error. Thus, implementing either trait would violate the orphan rule; the upstream crate could implement Error and this would imply an implementation for IntoReport/Context.

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

Implementations on Foreign Types§

source§

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

Available on crate feature anyhow only.
§

type Err = Error

§

type Ok = T

source§

fn into_report(self) -> Result<T, AnyhowError>

source§

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

Available on crate feature eyre only.
§

type Err = Report

§

type Ok = T

source§

fn into_report(self) -> Result<T, EyreReport>

Implementors§