Function chomp::parsers::token [] [src]

pub fn token<I: Input>(i: I, t: I::Token) -> SimpleResult<I, I::Token>

Matches a single token, returning the match on success.

If the buffer length is 0 this parser is considered incomplete.

use chomp::prelude::{parse_only, token};

assert_eq!(parse_only(|i| token(i, b'a'), b"abc"), Ok(b'a'));