Skip to main content

encode_shutdown_communication

Function encode_shutdown_communication 

Source
pub fn encode_shutdown_communication(reason: &str) -> Bytes
Expand description

Encode a shutdown communication reason string (RFC 8203).

The format is: 1-byte length prefix + UTF-8 string, max 128 bytes. If the reason exceeds 128 bytes, it is truncated at a char boundary. An empty reason encodes as a zero-length field ([0]).