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

pub fn digit<I>() -> Digit<I> where
    I: Stream<Item = u8>, 

Parses a base-10 digit (0–9).

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