[][src]Function combine::many1

pub fn many1<F, P>(p: P) -> Many1<F, P> where
    F: Extend<P::Output> + Default,
    P: Parser

Parses p one 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 many1 many1::<Vec<_>, _>(...).

NOTE: If p can succeed without consuming any input this may hang forever as many1 will repeatedly use p to parse the same location in the input every time

let result = many1::<Vec<_>, _>(digit())
    .parse("A123");
assert!(result.is_err());