Function chomp::parsers::token
[−]
[src]
pub fn token<I: Copy + PartialEq>(i: Input<I>, t: I) -> SimpleResult<I, I>
Matches a single token, returning the match on success.
If the buffer length is 0 this parser is considered incomplete.
use chomp::{parse_only, token}; assert_eq!(parse_only(|i| token(i, b'a'), b"abc"), Ok(b'a'));