pub trait GenericError: Sized {
    type Inner;
    fn to_errors(self) -> Result<Self::Inner, Errors>;
}
Expand description

A trait to convert a specific result type into a generic one. This lets you convert Result<T, E> or Result<T, Vec<E>> into Result<T, Errors> for any error type E defined in this library. In this way you can ignore the specific type of error when you don’t need to handle them explicitly (which is most of the time).

Example Usage:

fn test() -> Result<(), Errors> {
    ...
    let program = parser.done().to_errors()?;
    program.type_check().to_errors()?;
}

Associated Types

Required methods

Convert any errors in this type to generic errors.

Implementations on Foreign Types

Implementors