[−][src]Trait kombi::Parser
Associated Types
type Output
Required methods
fn parse(&self, i: Iter) -> Option<(Iter, Self::Output)>
Tries to parse the provided Iterator. Returns the unparsed rest of the data and a value on success.
Provided methods
fn many(self) -> Many<Iter, Self>
Runs the Parser repeatedly until it fails. The results are stored in a Vec
.
fn maybe(self) -> Maybe<Iter, Self>
Make the Parser optional, so that it will succeed even if it fails.
fn or<Other: Parser<Iter>>(self, other: Other) -> Or<Iter, Self, Other>
Require that either this or the provided Parser succeed. If both succeed, the one that has consumed the most bytes will be chosen.
fn then<Other: Parser<Iter>>(self, other: Other) -> Then<Iter, Self, Other>
Chain two Parsers together, requiring both to succeed.
fn transform<F: Fn(Self::Output) -> Option<T>, T>(
self,
f: F
) -> Transform<Iter, Self, F, T>
self,
f: F
) -> Transform<Iter, Self, F, T>
Apply the provided function to the Output of this Parser.
Implementations on Foreign Types
impl<Iter> Parser<Iter> for char where
Iter: Iterator<Item = char> + Clone,
[src]
Iter: Iterator<Item = char> + Clone,
Matches for a character.
impl<'a, Iter> Parser<Iter> for &'a str where
Iter: Iterator<Item = char> + Clone,
[src]
Iter: Iterator<Item = char> + Clone,
Matches for a string.
impl<Iter> Parser<Iter> for () where
Iter: Iterator + Clone,
[src]
Iter: Iterator + Clone,
()
ensures that there is no remaining data.
Implementors
impl<Iter> Parser<Iter> for NaturalNumber where
Iter: Iterator<Item = char> + Clone,
[src]
Iter: Iterator<Item = char> + Clone,
impl<Iter, A> Parser<Iter> for Many<Iter, A> where
Iter: Iterator + Clone,
A: Parser<Iter>,
[src]
Iter: Iterator + Clone,
A: Parser<Iter>,
impl<Iter, A> Parser<Iter> for Maybe<Iter, A> where
Iter: Iterator + Clone,
A: Parser<Iter>,
[src]
Iter: Iterator + Clone,
A: Parser<Iter>,
impl<Iter, A, B> Parser<Iter> for Or<Iter, A, B> where
Iter: Iterator + Clone,
A: Parser<Iter>,
B: Parser<Iter>,
[src]
Iter: Iterator + Clone,
A: Parser<Iter>,
B: Parser<Iter>,
type Output = Either<A::Output, B::Output>
fn parse(&self, i: Iter) -> Option<(Iter, Self::Output)>
[src]
impl<Iter, A, B> Parser<Iter> for Then<Iter, A, B> where
Iter: Iterator + Clone,
A: Parser<Iter>,
B: Parser<Iter>,
[src]
Iter: Iterator + Clone,
A: Parser<Iter>,
B: Parser<Iter>,
impl<Iter, A, F, T> Parser<Iter> for Transform<Iter, A, F, T> where
Iter: Iterator + Clone,
A: Parser<Iter>,
F: Fn(A::Output) -> Option<T>,
[src]
Iter: Iterator + Clone,
A: Parser<Iter>,
F: Fn(A::Output) -> Option<T>,
impl<Iter, F, T> Parser<Iter> for F where
Iter: Iterator + Clone,
F: Fn(Iter) -> Option<(Iter, T)>,
[src]
Iter: Iterator + Clone,
F: Fn(Iter) -> Option<(Iter, T)>,