Function combine::range::take_until_range [] [src]

pub fn take_until_range<I>(r: I::Range) -> TakeUntilRange<I> where
    I: RangeStream

Zero-copy parser which reads a range of 0 or more tokens until r is found.

The range r will not be consumed. If r is not found, the parser will return an error.

let mut parser = take_until_range("\r\n");
let result = parser.parse("To: user@example.com\r\n");
assert_eq!(result, Ok(("To: user@example.com", "\r\n")));
let result = parser.parse("Hello, world\n");
assert!(result.is_err());