Trait utils::input::MapWithInputExt

source ·
pub trait MapWithInputExt {
    type Output;

    // Required method
    fn map_with_input(self, input: &str) -> Self::Output;
}
Expand description

Extension trait to simplify converting errors and locations into InputErrors.

Note that constructing InputError is expensive, and therefore conversion should be done as late as possible, to avoid unnecessary work if the error is discarded (for example, by Parser::or).

Required Associated Types§

Required Methods§

source

fn map_with_input(self, input: &str) -> Self::Output

Implementations on Foreign Types§

source§

impl<E: Into<Box<dyn Error>>, I: ToIndex> MapWithInputExt for (E, I)

source§

type Output = InputError

source§

fn map_with_input(self, input: &str) -> Self::Output

source§

impl<T, E: Into<Box<dyn Error>>, I: ToIndex> MapWithInputExt for Result<T, (E, I)>

source§

type Output = Result<T, InputError>

source§

fn map_with_input(self, input: &str) -> Self::Output

Implementors§