pub fn encode_to_buf(msg: &Message, buf: &mut Vec<u8>) -> ProtocolResult<()>
Encodes a message to a byte buffer using the length-prefixed frame format.
Frame format: [len: u32 BE][id: u32 BE][flags: u8][CBOR(v, t, p)]
[len: u32 BE][id: u32 BE][flags: u8][CBOR(v, t, p)]