Function nom::character::streaming::one_of[][src]

pub fn one_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>, 

Recognizes one of the provided characters.

streaming version: Will return Err(nom::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::Size(1))));