[][src]Function combine::parser::byte::byte

pub fn byte<I>(c: u8) -> Token<I> where
    I: Stream<Item = u8>,
    I::Error: ParseError<I::Item, I::Range, I::Position>, 

Parses a byte and succeeds if the byte is equal to c.

use combine::Parser;
use combine::parser::byte::byte;
assert_eq!(byte(b'!').parse(&b"!"[..]), Ok((b'!', &b""[..])));
assert!(byte(b'A').parse(&b""[..]).is_err());
assert!(byte(b'A').parse(&b"!"[..]).is_err());