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

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

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());