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

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

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

use combine::Parser;
use combine::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());