Skip to main content

encode_chunk

Function encode_chunk 

Source
pub fn encode_chunk(chunk: &BytecodeChunk) -> Result<Vec<u8>, EncodeError>
Expand description

Encodes a chunk back into upstream wire bytes.

§Errors

Errors if any instruction’s pre-decoded operand fields disagree with a re-decode of its header word — the result of mutating one side of an Instruction directly. Neither side wins silently; rebuild the instruction through a constructor such as Instruction::from_words instead of mutating fields. Upstream fixture encoding also errors if a proto omits metadata required by its fixture-only bytecode version.