fuel_asm

Function from_bytes

source
pub fn from_bytes<I>(
    bs: I,
) -> impl Iterator<Item = Result<Instruction, InvalidOpcode>>
where I: IntoIterator<Item = u8>,
Expand description

Given an iterator yielding bytes, produces an iterator yielding Instructions.

This function assumes each consecutive 4 bytes aligns with an instruction.

The produced iterator yields an Err in the case that an instruction fails to parse from 4 consecutive bytes.