Struct peruse::parsers::RepSepParser
[−]
[src]
pub struct RepSepParser<A, B> { pub rep: A, pub sep: B, pub min_reps: usize, }
A Parser that will repeatedly parse rep
and sep
in sequence until sep
returns an error. The accumulated rep
results are returned. If rep
returns an error at any time, the error is escelated.
Fields
rep: A
sep: B
min_reps: usize
Trait Implementations
impl<I: ?Sized, A: Parser<I = I>, B: Parser<I = I>> Parser for RepSepParser<A, B>
[src]
type I = I
type O = Vec<A::O>
fn parse<'a>(&self, data: &'a Self::I) -> ParseResult<&'a Self::I, Self::O>
impl<I: ?Sized, A: ParserCombinator<I = I>, B: ParserCombinator<I = I>> ParserCombinator for RepSepParser<A, B>
[src]
fn then<P: Parser<I = Self::I>>(&self, p: P) -> ChainedParser<Self, P>
Chain this parser with another parser, creating new parser that returns a tuple of their results Read more
fn then_r<P: ParserCombinator<I = Self::I>>(
&self,
p: P
) -> MapParser<Self::I, ChainedParser<Self, P>, P::O>
&self,
p: P
) -> MapParser<Self::I, ChainedParser<Self, P>, P::O>
Chain this parser with another parser, but toss the value from this parser
fn then_l<P: ParserCombinator<I = Self::I>>(
&self,
p: P
) -> MapParser<Self::I, ChainedParser<Self, P>, Self::O>
&self,
p: P
) -> MapParser<Self::I, ChainedParser<Self, P>, Self::O>
Chain this parser with another parser, but toss the value from the other parser
fn repeat(&self) -> RepeatParser<Self>
Create a new parser that will repeat this parser until it returns an error
fn map<T, F: 'static + Fn(Self::O) -> T>(
&self,
f: F
) -> MapParser<Self::I, Self, T>
&self,
f: F
) -> MapParser<Self::I, Self, T>
Map the value of this parser
fn or<P: Parser<I = Self::I, O = Self::O>>(&self, p: P) -> OrParser<Self, P>
Create a disjunction with another parser. If this parser produces an error, the other parser will be used
impl<I: ?Sized, A: ParserCombinator<I = I>, B: ParserCombinator<I = I>> Clone for RepSepParser<A, B>
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more