regex_automata::util::wire

Function read_endianness_check

source
pub(crate) fn read_endianness_check(
    slice: &[u8],
) -> Result<usize, DeserializeError>
Expand description

Reads the endianness check from the beginning of the given slice and confirms that the endianness of the serialized object matches the expected endianness. If the slice is too small or if the endianness check fails, this returns an error.

Upon success, the total number of bytes read is returned.