pub fn encode_frame(payload: &[u8]) -> Result<Vec<u8>, FrameError>
Encode a payload as a 4-byte big-endian length prefix followed by the body.