Function combine::count [] [src]

pub fn count<F, P>(count: usize, parser: P) -> Count<F, P> where
    P: Parser,
    F: FromIterator<P::Output>, 

Parses parser from zero up to count times.

let mut parser = count(2, token(b'a'));

let result = parser.parse(&b"aaab"[..]);
assert_eq!(result, Ok((b"aa"[..].to_owned(), &b"ab"[..])));