pub fn hex_u32<I, E: ParseError<I>>(input: I) -> IResult<I, u32, E>where
I: Stream,
<I as Stream>::Token: AsChar,
<I as Stream>::Slice: AsBStr,👎Deprecated since 0.1.0: Replaced with <code>winnow::character::hex_uint</code>
Expand description
Recognizes a hex-encoded integer.
Complete version: Will parse until the end of input if it has less than 8 bytes.
use winnow::number::complete::hex_u32;
let parser = |s| {
hex_u32(s)
};
assert_eq!(parser(&b"01AE"[..]), Ok((&b""[..], 0x01AE)));
assert_eq!(parser(&b"abc"[..]), Ok((&b""[..], 0x0ABC)));
assert_eq!(parser(&b"ggg"[..]), Err(ErrMode::Backtrack(Error::new(&b"ggg"[..], ErrorKind::IsA))));WARNING: Deprecated, replaced with winnow::character::hex_uint