Function token

Source
pub fn token<I>(c: I::Item) -> Token<I>
where I: Stream, I::Item: PartialEq,
Expand description

Parses a character and succeeds if the characther is equal to c

let result = token('!')
    .parse("!")
    .map(|x| x.0);
assert_eq!(result, Ok('!'));