Function combine::one_of [−][src]
pub fn one_of<T, Input>(tokens: T) -> OneOf<T, Input> where
T: Clone + IntoIterator,
Input: Stream,
Input::Token: PartialEq<T::Item>,
Expand description
Extract one token and succeeds if it is part of tokens
.
let result = many(one_of("abc".chars())) .parse("abd"); assert_eq!(result, Ok((String::from("ab"), "d")));