Function combine::parser::range::range[][src]

pub fn range<Input>(i: Input::Range) -> Range<Input> where
    Input: RangeStream,
    Input::Range: PartialEq
Expand description

Zero-copy parser which reads a range of length i.len() and succeeds if i is equal to that range.

tokens is a non-RangeStream alternative.

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());