pub fn decode_snapshot_chunk(buf: &[u8]) -> Result<(&[u8], usize), WireError>Expand description
Decode the next snapshot chunk ($L\r\n<L bytes>\r\n) at the
front of buf. Returns:
Ok((chunk_bytes, used))—chunk_bytesborrows frombuf;usedbytes were consumed.Err(WireError::Truncated)— not enough bytes for a complete chunk yet.Err(WireError::BadEnvelope)— header wasn’t$L\r\n,LexceededSNAPSHOT_CHUNK_MAX,Lparsed as non-numeric, or the trailing CRLF was missing.