pub trait ParserExt: Parser {
    // Provided methods
    fn or<V: Parser<Error = E, Output = O, PartialState = PA>, E, O, PA>(
        self,
        other: V
    ) -> ChoiceParser<Self, V>
       where Self: Sized { ... }
    fn then<V: Parser<Error = E, Output = O, PartialState = PA>, E, O, PA>(
        self,
        other: V
    ) -> SequenceParser<Self, V>
       where Self: Sized { ... }
    fn repeat(self, length_range: RangeInclusive<usize>) -> RepeatParser<Self>
       where Self: Sized { ... }
    fn map_output<F: Fn(Self::Output) -> O, O>(
        self,
        f: F
    ) -> MapOutputParser<Self, F, O>
       where Self: Sized { ... }
    fn boxed(self) -> ArcParser
       where Self: CreateParserState + Sized + Send + Sync + 'static,
             Self::Error: Error + Send + Sync + 'static,
             Self::Output: Send + Sync + 'static,
             Self::PartialState: Send + Sync + 'static { ... }
}
Expand description

An extension trait for parsers.

Provided Methods§

source

fn or<V: Parser<Error = E, Output = O, PartialState = PA>, E, O, PA>( self, other: V ) -> ChoiceParser<Self, V>
where Self: Sized,

Parse this parser, or another other parser.

source

fn then<V: Parser<Error = E, Output = O, PartialState = PA>, E, O, PA>( self, other: V ) -> SequenceParser<Self, V>
where Self: Sized,

Parse this parser, then the other parser.

source

fn repeat(self, length_range: RangeInclusive<usize>) -> RepeatParser<Self>
where Self: Sized,

Repeat this parser a number of times.

source

fn map_output<F: Fn(Self::Output) -> O, O>( self, f: F ) -> MapOutputParser<Self, F, O>
where Self: Sized,

Map the output of this parser.

source

fn boxed(self) -> ArcParser
where Self: CreateParserState + Sized + Send + Sync + 'static, Self::Error: Error + Send + Sync + 'static, Self::Output: Send + Sync + 'static, Self::PartialState: Send + Sync + 'static,

Get a boxed version of this parser.

Implementors§

source§

impl<P: Parser> ParserExt for P