Struct combpop::iter::Collect
[−]
[src]
pub struct Collect<P, V>(_, _)
where
P: ParserIteratorBase,
V: FromIterator<P::Element>;
Trait Implementations
impl<P, V> ParserBase for Collect<P, V> where
P: ParserIteratorBase,
V: FromIterator<P::Element>,
[src]
P: ParserIteratorBase,
V: FromIterator<P::Element>,
type Input = P::Input
The input type of the parser. u8
for byte-eating parsers.
type Output = V
The output type which this monadic parser produces.
fn emptiable() -> bool
[src]
Whether the parser "usually" accepts the empty sequence. Only used in emit_expectations
.
fn map_once<O, F>(self, f: F) -> Map<O, Self, F> where
Self: Sized,
F: FnOnce(Self::Output) -> O,
[src]
Self: Sized,
F: FnOnce(Self::Output) -> O,
Converts a semantic value after parsing. Similar to ParserBase::map
, but accepts FnOnce
closures. Read more
fn map_mut<O, F>(self, f: F) -> Map<O, Self, F> where
Self: Sized,
F: FnMut(Self::Output) -> O,
[src]
Self: Sized,
F: FnMut(Self::Output) -> O,
Converts a semantic value after parsing. Similar to ParserBase::map
, but accepts FnMut
closures. Read more
fn map<O, F>(self, f: F) -> Map<O, Self, F> where
Self: Sized,
F: Fn(Self::Output) -> O,
[src]
Self: Sized,
F: Fn(Self::Output) -> O,
Converts a semantic value after parsing.
fn and_then_once<P, F>(self, f: F) -> AndThen<Self, P, F> where
Self: Sized,
P: ParserBase<Input = Self::Input>,
F: FnOnce(Self::Output) -> P,
[src]
Self: Sized,
P: ParserBase<Input = Self::Input>,
F: FnOnce(Self::Output) -> P,
Monadic operator: run another parser f(x)
after parsing. Similar to ParserBase::and_then
, but accepts FnOnce
closures. Read more
fn and_then_mut<P, F>(self, f: F) -> AndThen<Self, P, F> where
Self: Sized,
P: ParserBase<Input = Self::Input>,
F: FnMut(Self::Output) -> P,
[src]
Self: Sized,
P: ParserBase<Input = Self::Input>,
F: FnMut(Self::Output) -> P,
Monadic operator: run another parser f(x)
after parsing. Similar to ParserBase::and_then
, but accepts FnMut
closures. Read more
fn and_then<P, F>(self, f: F) -> AndThen<Self, P, F> where
Self: Sized,
P: ParserBase<Input = Self::Input>,
F: Fn(Self::Output) -> P,
[src]
Self: Sized,
P: ParserBase<Input = Self::Input>,
F: Fn(Self::Output) -> P,
Monadic operator: run another parser f(x)
after parsing. Read more
fn concat<P>(self, p: P) -> Concat2<Self, P> where
Self: Sized,
P: ParserBase<Input = Self::Input>,
[src]
Self: Sized,
P: ParserBase<Input = Self::Input>,
Applicative operator: run another parser p
after parsing. The result is a pair of the result of the parsers. Read more
fn or<P>(self, p: P) -> Choice2<Self, P> where
Self: Sized,
P: ParserBase<Input = Self::Input, Output = Self::Output>,
[src]
Self: Sized,
P: ParserBase<Input = Self::Input, Output = Self::Output>,
If the parser failed without consumption, try another parser.
fn many1(self) -> Many1<Self> where
Self: Sized,
[src]
Self: Sized,
Returns a ParserIteratorBase
that collects one or more objects from this parser.
impl<S: ?Sized, P, V> ParserOnce<S> for Collect<P, V> where
S: Stream<Item = P::Input>,
P: ParserIteratorMut<S>,
V: FromIterator<P::Element>,
[src]
S: Stream<Item = P::Input>,
P: ParserIteratorMut<S>,
V: FromIterator<P::Element>,
fn parse_lookahead_once(
self,
stream: &mut S
) -> ParseResult<Option<(Self::Output, Consume)>>
[src]
self,
stream: &mut S
) -> ParseResult<Option<(Self::Output, Consume)>>
fn emit_expectations(&self, stream: &mut S)
[src]
impl<S: ?Sized, P, V> ParserMut<S> for Collect<P, V> where
S: Stream<Item = P::Input>,
P: ParserIteratorMut<S>,
V: FromIterator<P::Element>,
[src]
S: Stream<Item = P::Input>,
P: ParserIteratorMut<S>,
V: FromIterator<P::Element>,
fn parse_lookahead_mut(
&mut self,
stream: &mut S
) -> ParseResult<Option<(Self::Output, Consume)>>
[src]
&mut self,
stream: &mut S
) -> ParseResult<Option<(Self::Output, Consume)>>
fn parse_mut(&mut self, stream: &mut S) -> ParseResult<Self::Output>
[src]
fn parse_consume_mut(
&mut self,
stream: &mut S
) -> ParseResult<(Self::Output, Consume)>
[src]
&mut self,
stream: &mut S
) -> ParseResult<(Self::Output, Consume)>
impl<S: ?Sized, P, V> Parser<S> for Collect<P, V> where
S: Stream<Item = P::Input>,
P: ParserIterator<S>,
V: FromIterator<P::Element>,
[src]
S: Stream<Item = P::Input>,
P: ParserIterator<S>,
V: FromIterator<P::Element>,
fn parse_lookahead(
&self,
stream: &mut S
) -> ParseResult<Option<(Self::Output, Consume)>>
[src]
&self,
stream: &mut S
) -> ParseResult<Option<(Self::Output, Consume)>>