pub fn encode(header: &str, payload: &[u8]) -> Vec<u8> ⓘExpand description
Build the binary sandwich. header is the frame’s full JSON
envelope (minus the payload bytes, which its serde representation
skips); payload may be empty (chunk variants are ALWAYS binary,
content notwithstanding — the framing is variant-keyed, never
content-sniffed).