Skip to main content

check_offset_section

Function check_offset_section 

Source
pub fn check_offset_section<W: ZerocopyWord>(
    offsets: &[W],
    expected_count: usize,
    value_len: usize,
) -> Result<(), OffsetIntegrityIssue>
Expand description

Validates one offset section against expected_count rows and a backing values array of length value_len.

Performs four checks: length matches expected_count + 1, first offset is zero, offsets are non-decreasing, and the final offset matches value_len.

§Errors

Returns the first OffsetIntegrityIssue encountered.

§Performance

This function is O(offsets.len()).