Skip to main content

decode

Function decode 

Source
pub fn decode(buf: &[u8]) -> Result<DocumentRef<'_>, MessageError>
Expand description

Decode a Document envelope from buf (the payload region after the 16-byte peat-lite header). Returns a borrowing view; bumps any length-related parse error to a single error variant rather than returning partial data, matching how the rest of the protocol module surfaces malformed wire input.