Skip to main content

decode_frame

Function decode_frame 

Source
pub fn decode_frame(buf: &[u8]) -> Result<(u64, Argv, usize), WireError>
Expand description

Decode the first complete frame at the front of buf.

Returns (offset, argv, used) on success; used is the number of bytes the frame consumed (advance the caller’s read cursor by that much). On WireError::Truncated, the caller should read more bytes and retry; any other error signals an unrecoverable peer violation.