Function combine::parser::byte::crlf

source ·
pub fn crlf<Input>() -> impl Parser<Input, Output = u8, PartialState = ()>
where Input: Stream<Token = u8>,
Expand description

Parses carriage return and newline (&b"\r\n"), returning the newline byte.

use combine::Parser;
use combine::parser::byte::crlf;
assert_eq!(crlf().parse(&b"\r\n"[..]), Ok((b'\n', &b""[..])));
assert!(crlf().parse(&b"\r"[..]).is_err());
assert!(crlf().parse(&b"\n"[..]).is_err());