Function regex_automata::util::wire::write_label

source ยท
pub(crate) fn write_label(
    label: &str,
    dst: &mut [u8],
) -> Result<usize, SerializeError>
Expand description

Writes the given label to the buffer as a NUL terminated string. The label given must not contain NUL, otherwise this will panic. Similarly, the label must not be longer than 255 bytes, otherwise this will panic.

Additional NUL bytes are written as necessary to ensure that the number of bytes written is always a multiple of 4.

Upon success, the total number of bytes written (including padding) is returned.