Function encode
Source pub fn encode(data: &[u8]) -> Vec<u8> ⓘ
Expand description
Encode a full message.
Encodes a single message and returns it as a Vec
. The returned data does
not include any 0x00
separator byte, you have to add it yourself.
This is a convenience function using Encoder internally. For streaming encoding, use Encoder.