Function nom::character::complete::none_of

source ·
pub fn none_of<I, T, Error: ParseError<I>>(
    list: T
) -> impl Fn(I) -> IResult<I, char, Error>where
    I: Slice<RangeFrom<usize>> + InputIter,
    <I as InputIter>::Item: AsChar + Copy,
    T: FindToken<<I as InputIter>::Item>,
Expand description

Recognizes a character that is not in the provided characters.

Complete version: Will return an error if there’s not enough input data.

Example

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