rustmax::nom::character::streaming

Function none_of

Source
pub fn none_of<I, T, Error>(list: T) -> impl FnMut(I)
where Error: ParseError<I>, I: Input, <I as Input>::Item: AsChar, T: FindToken<char>,
Expand description

Recognizes a character that is not in the provided characters.

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

§Example

assert_eq!(none_of::<_, _, (_, ErrorKind)>("abc")("z"), Ok(("", 'z')));
assert_eq!(none_of::<_, _, (_, ErrorKind)>("ab")("a"), Err(Err::Error(("a", ErrorKind::NoneOf))));
assert_eq!(none_of::<_, _, (_, ErrorKind)>("a")(""), Err(Err::Incomplete(Needed::Unknown)));