Skip to main content

decode

Function decode 

Source
pub fn decode(bytes: &[u8]) -> Option<(Inst, u8)>
Expand description

Decode a single instruction starting at bytes[0].

Returns (inst, byte_length) where byte_length is 2 (compressed) or 4 (standard). Returns None if fewer than 2 bytes are available or the first 2 bytes are zero (which is Reserved shape — we treat as decode failure to give the caller a clean signal).