Function nom::character::complete::crlf [−][src]
pub fn crlf<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> where
T: Slice<Range<usize>> + Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
T: InputIter,
T: Compare<&'static str>,
Recognizes the string “\r\n”.
complete version: Will return an error if there’s not enough input data.
Example
fn parser(input: &str) -> IResult<&str, &str> { crlf(input) } assert_eq!(parser("\r\nc"), Ok(("c", "\r\n"))); assert_eq!(parser("ab\r\nc"), Err(Err::Error(("ab\r\nc", ErrorKind::CrLf)))); assert_eq!(parser(""), Err(Err::Error(("", ErrorKind::CrLf))));