Function regex_automata::util::wire::read_label
source · pub(crate) fn read_label(
slice: &[u8],
expected_label: &'static str,
) -> Result<usize, DeserializeError>
Expand description
Reads a NUL terminated label starting at the beginning of the given slice.
If a NUL terminated label could not be found, then an error is returned. Similarly, if a label is found but doesn’t match the expected label, then an error is returned.
Upon success, the total number of bytes read (including padding bytes) is returned.