Function combine::parser::byte::take_until_byte3 [] [src]

pub fn take_until_byte3<I>(a: u8, b: u8, c: u8) -> TakeUntilByte3<I> where
    I: RangeStream + FullRangeStream,
    I::Range: AsRef<[u8]>, 

Zero-copy parser which reads a range of 0 or more tokens until a, 'b' or c is found.

If a, 'b' or c is not found, the parser will return an error.

let mut parser = take_until_byte3(b'\r', b'\n', b' ');
let result = parser.parse("To: user@example.com\r\n");
assert_eq!(result, Ok(("To:", " user@example.com\r\n")));
let result = parser.parse("Helloworld");
assert!(result.is_err());