Function chomp::parsers::take
[−]
[src]
pub fn take<I: Input>(i: I, num: usize) -> SimpleResult<I, I::Buffer>
Matches num
items no matter what they are, returning a slice of the matched items.
If the buffer length is less than num
this parser is considered incomplete.
use chomp::prelude::{parse_only, take}; assert_eq!(parse_only(|i| take(i, 3), b"abcd"), Ok(&b"abc"[..]));