Skip to main content

envelope_head

Function envelope_head 

Source
pub fn envelope_head(buf: &[u8]) -> Result<Option<EnvelopeHead>, CanonicalError>
Expand description

Parse the response head out of however much of the delegate’s stdout has arrived (spec §5.2). Ok(None) = still incomplete, read more; Ok(Some(head)) = parsed, with head.body_start splitting the buffer; Err = malformed or oversized (spec §6, → exit 69). Caller-owned buffer, so the codec stays a pure function of the bytes so far — no hidden state, and every arm is reachable from a table test.