Skip to main content

decode

Function decode 

Source
pub fn decode(frame: &[u8]) -> Option<(&str, &[u8])>
Expand description

Split a binary sandwich back into (header JSON, payload bytes). None on anything malformed — a short frame, a header length past the end, or a non-UTF-8 header. Malformed frames are DROPPED by receivers (forward-compat posture, mirroring unknown text frames).