Function combine::parser::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.
repeat::take_until
is a non-RangeStream
alternative.
let mut parser = take_until_range("\r\n"); let result = parser.parse("To: [email protected]\r\n"); assert_eq!(result, Ok(("To: [email protected]", "\r\n"))); let result = parser.parse("Hello, world\n"); assert!(result.is_err());