pub fn encode_binary<B: BufMut>(buf: &mut B, data: &[u8]) -> Result<()>Expand description
Encodes binary data with a 2-byte length prefix (compatibility function)
This function provides compatibility with the old binary module API.
Prefer using MqttBinary::create(data)?.to_be_bytes() for new code.
ยงErrors
Returns an error if the data length exceeds maximum