Trait kalosm_sample::ParserExt
source · 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§
sourcefn or<V: Parser<Error = E, Output = O, PartialState = PA>, E, O, PA>(
self,
other: V
) -> ChoiceParser<Self, V>where
Self: Sized,
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.
sourcefn then<V: Parser<Error = E, Output = O, PartialState = PA>, E, O, PA>(
self,
other: V
) -> SequenceParser<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,
Parse this parser, then the other parser.
sourcefn repeat(self, length_range: RangeInclusive<usize>) -> RepeatParser<Self>where
Self: Sized,
fn repeat(self, length_range: RangeInclusive<usize>) -> RepeatParser<Self>where
Self: Sized,
Repeat this parser a number of times.
sourcefn map_output<F: Fn(Self::Output) -> O, O>(
self,
f: F
) -> MapOutputParser<Self, F, O>where
Self: Sized,
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.