pub trait IntoDiagnostic<T, E> {
    fn into_diagnostic(self) -> Result<T, Report>;
}
Expand description

Convenience trait that adds a .into_diagnostic() method that converts a type implementing std::error::Error to a Result<T, Report>.

Warning

Calling this on a type implementing Diagnostic will reduce it to the common denominator of std::error::Error. Meaning all extra information provided by Diagnostic will be inaccessible. If you have a type implementing Diagnostic consider simply returning it or using Into or the Try operator (?).

Required Methods

Converts Result types that return regular std::error::Errors into a Result that returns a Diagnostic.

Implementations on Foreign Types

Implementors