Skip to main content

parse_envelope

Function parse_envelope 

Source
pub fn parse_envelope(buf: &[u8]) -> Result<(&[u8], &[u8]), String>
Expand description

Helper exposed for tests / plugin authors: parse the envelope shape [state_len: u32 LE][state_bytes][ipc_stream_bytes].

Returns (state, ipc). The plugin uses the equivalent of this on its side to recover state + values per update/merge call.

ยงErrors

Returns a string error if the buffer is shorter than 4 bytes or the declared state length overruns the buffer.