pub fn parse_u32_saturating(digits: &[u8]) -> Result<u32, ParseError>Expand description
Parses 1*DIGIT by the delta-seconds rule of RFC 9111 section 1.2.2:
any number of digits, values above 2147483648 give 2147483648.
§Errors
ErrorKind::Empty, ErrorKind::InvalidNumber.
§Examples
use parse_net::num::parse_u32_saturating;
assert_eq!(parse_u32_saturating(b"60")?, 60);
assert_eq!(parse_u32_saturating(b"99999999999999999999")?, 2_147_483_648);