nom8::character::streaming

Function one_of

Source
pub fn one_of<I, T, Error: ParseError<I>>(
    list: T,
) -> impl Fn(I) -> IResult<I, char, Error>
👎Deprecated since 8.0.0: Replaced with nom8::bytes::one_of with input wrapped in nom8::input::Streaming
Expand description

Recognizes one of the provided characters.

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

§Example

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::new(1))));

WARNING: Deprecated, replaced with nom8::bytes::one_of with input wrapped in nom8::input::Streaming