Skip to main content

decode

Function decode 

Source
pub fn decode(buf: &[u8]) -> Result<(Frame, usize), FrameError>
Expand description

Attempt to decode one frame from the front of buf.

On success returns (frame, consumed). The caller drops consumed bytes from the read buffer. ShortHeader / ShortPayload are not fatal — the caller should read more bytes and retry.