combine::parser::char

Function crlf

Source
pub fn crlf<I>() -> CrLf<I>
where I: Stream<Item = char>, I::Error: ParseError<I::Item, I::Range, I::Position>,
Expand description

Parses carriage return and newline ("\r\n"), returning the newline character.

use combine::Parser;
use combine::parser::char::crlf;
assert_eq!(crlf().parse("\r\n"), Ok(('\n', "")));
assert!(crlf().parse("\r").is_err());
assert!(crlf().parse("\n").is_err());