Function one_of

fn one_of<I, T, Error: ParseError<I>>(list: T) -> impl FnMut(I) -> crate::internal::IResult<I, char, Error>
where
    I: Input,
    <I as Input>::Item: AsChar,
    T: FindToken<char>

Recognizes one of the provided characters.

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

Example

# use nom::{Err, error::ErrorKind, Needed};
# use nom::character::streaming::one_of;
assert_eq!(one_of::<_, _, (_, ErrorKind)>("abc")("b"), Ok(("", 'b')));
assert_eq!(one_of::<_, _, (_, ErrorKind)>("a")("bc"), Err(Err::Error(("bc", ErrorKind::OneOf))));
assert_eq!(one_of::<_, _, (_, ErrorKind)>("a")(""), Err(Err::Incomplete(Needed::Unknown)));