Skip to main content

read_flat_op_padded_bytes

Function read_flat_op_padded_bytes 

Source
pub fn read_flat_op_padded_bytes<'a>(
    bytes: &'a [u8],
    pos: &mut usize,
    max_bytes: u32,
) -> Result<&'a [u8], FlatOpStrError>
Expand description

Validates and borrows the raw payload of a [byte_len: u32 LE, bytes..., zero_pad...] block (the byte form of write_flat_op_bytes_words) at bytes[*pos], advancing *pos past the 4-byte-padded block on success.

Leaves *pos unchanged on error. Zero-unsafe and zero-allocation.