pub fn one_of<I, T, Error: ParseError<I>>(
list: T
) -> impl Fn(I) -> IResult<I, char, Error>where
I: Stream,
<I as Stream>::Token: AsChar + Copy,
T: ContainsToken<<I as Stream>::Token>,👎Deprecated since 0.1.0: Replaced with <code>winnow::bytes::one_of</code>
Expand description
Recognizes one of the provided characters.
Complete version: Will return an error if there’s not enough input data.
Example
assert_eq!(one_of::<_, _, Error<_>>("abc")("b"), Ok(("", 'b')));
assert_eq!(one_of::<_, _, Error<_>>("a")("bc"), Err(ErrMode::Backtrack(Error::new("bc", ErrorKind::OneOf))));
assert_eq!(one_of::<_, _, Error<_>>("a")(""), Err(ErrMode::Backtrack(Error::new("", ErrorKind::OneOf))));WARNING: Deprecated, replaced with winnow::bytes::one_of