pub fn write_utf8_string( buf: &mut [u8], s: &str, ) -> Result<usize, MqttError<ErrorPlaceHolder>>
Writes a UTF-8 encoded string (prefixed with a 2-byte length) to the buffer.