Function combine::range::range
[−]
[src]
pub fn range<I>(i: I::Range) -> Range<I> where I: RangeStream, I::Range: PartialEq + Range
Zero-copy parser which reads a range of length i.len()
and succeds if i
is equal to that
range.
let mut parser = range("hello"); let result = parser.parse("hello world"); assert_eq!(result, Ok(("hello", " world"))); let result = parser.parse("hel world"); assert!(result.is_err());