[][src]Function combine::parser::char::digit

pub fn digit<I>() -> Digit<I> where
    <I as StreamOnce>::Error: ParseError<<I as StreamOnce>::Item, <I as StreamOnce>::Range, <I as StreamOnce>::Position>,
    I: Stream<Item = char>, 

Parses a base-10 digit.

use combine::Parser;
use combine::parser::char::digit;
assert_eq!(digit().parse("9"), Ok(('9', "")));
assert!(digit().parse("A").is_err());