Skip to main content

read_flat_op_str_bytes

Function read_flat_op_str_bytes 

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

Validates and borrows a zero-copy &str from a little-endian byte buffer at bytes[*pos], advancing *pos past the 4-byte-padded block on success.

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