[][src]Function nom::character::streaming::not_line_ending

pub fn not_line_ending<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> where
    T: Slice<Range<usize>> + Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
    T: InputIter + InputLength,
    T: Compare<&'static str>,
    <T as InputIter>::Item: AsChar,
    <T as InputIter>::Item: AsChar

Recognizes a string of any char except '\r' or '\n'.

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

Example

assert_eq!(not_line_ending::<_, (_, ErrorKind)>("ab\r\nc"), Ok(("\r\nc", "ab")));
assert_eq!(not_line_ending::<_, (_, ErrorKind)>("abc"), Err(Err::Incomplete(Needed::Unknown)));
assert_eq!(not_line_ending::<_, (_, ErrorKind)>(""), Err(Err::Incomplete(Needed::Unknown)));