pub fn encode(frame: &Frame) -> Result<Bytes, ProtocolError>Expand description
Encode a frame to bytes.
The encoded format is:
- 4 bytes: Big-endian length prefix
- N bytes: MessagePack-encoded frame
ยงErrors
Returns an error if the frame is too large or encoding fails.