[−][src]Function combine::parser::byte::digit
pub fn digit<I>() -> Digit<I> where
I: Stream<Item = u8>,
I::Error: ParseError<I::Item, I::Range, I::Position>,
Parses a base-10 digit (0–9).
use combine::Parser; use combine::parser::byte::digit; assert_eq!(digit().parse(&b"9"[..]), Ok((b'9', &b""[..]))); assert!(digit().parse(&b"A"[..]).is_err());