[][src]Function combine::none_of

pub fn none_of<T, I>(tokens: T) -> NoneOf<T, I> where
    T: Clone + IntoIterator,
    I: Stream,
    I::Item: PartialEq<T::Item>, 

Extract one token and succeeds if it is not part of tokens.

let mut parser = many1(none_of(b"abc".iter().cloned()));
let result = parser.easy_parse(State::new(&b"xyb"[..]))
    .map(|(output, input)| (output, input.input));
assert_eq!(result, Ok((b"xy"[..].to_owned(), &b"b"[..])));

let result = parser.easy_parse(State::new(&b"ab"[..]));
assert_eq!(result, Err(easy::Errors {
    position: 0,
    errors: vec![
        easy::Error::Unexpected(easy::Info::Token(b'a')),
    ]
}));