Function digit1
fn digit1<T, E: ParseError<T>>(input: T) -> crate::internal::IResult<T, T, E>
where
T: Input,
<T as Input>::Item: AsChar
Recognizes one or more ASCII numerical characters: 0-9
Complete version: Will return an error if there's not enough input data, or the whole input if no terminating token is found (a non digit character).
Example
# use ;
# use digit1;
assert_eq!;
assert_eq!;
assert_eq!;
Parsing an integer
You can use digit1 in combination with map_res to parse an integer:
# use ;
# use map_res;
# use digit1;
assert_eq!;
assert_eq!;
assert!;