Function regex_automata::util::wire::try_read_u32

source ยท
pub(crate) fn try_read_u32(
    slice: &[u8],
    what: &'static str,
) -> Result<(u32, usize), DeserializeError>
Expand description

Try to read a u32 from the beginning of the given slice in native endian format. If the slice has fewer than 4 bytes, then this returns an error. The error message will include the what description of what is being deserialized, for better error messages. what should be a noun in singular form.

Upon success, this also returns the number of bytes read.