[−][src]Function combine::count
pub fn count<F, P>(count: usize, parser: P) -> Count<F, P> where
<P::Input as StreamOnce>::Error: ParseError<<P::Input as StreamOnce>::Item, <P::Input as StreamOnce>::Range, <P::Input as StreamOnce>::Position>,
P: Parser,
F: Extend<P::Output> + Default,
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"[..])));