Function combine::combinator::many [] [src]

pub fn many<F, P>(p: P) -> Many<F, P> where
    P: Parser,
    F: FromIterator<P::Output>, 

Parses p zero or more times returning a collection with the values from p.

If the returned collection cannot be inferred type annotations must be supplied, either by annotating the resulting type binding let collection: Vec<_> = ... or by specializing when calling many, many::<Vec<_>, _>(...).

let result = many(digit())
    .parse("123A")
    .map(|x| x.0);
assert_eq!(result, Ok(vec!['1', '2', '3']));