Function crlf

fn crlf<T, E: ParseError<T>>(input: T) -> crate::internal::IResult<T, T, E>
where
    T: Input + Compare<&'static str>

Recognizes the string "\r\n".

Streaming version: Will return Err(nom::Err::Incomplete(_)) if there's not enough input data.

Example

# use nom::{Err, error::ErrorKind, IResult, Needed};
# use nom::character::streaming::crlf;
assert_eq!(crlf::<_, (_, ErrorKind)>("\r\nc"), Ok(("c", "\r\n")));
assert_eq!(crlf::<_, (_, ErrorKind)>("ab\r\nc"), Err(Err::Error(("ab\r\nc", ErrorKind::CrLf))));
assert_eq!(crlf::<_, (_, ErrorKind)>(""), Err(Err::Incomplete(Needed::new(2))));