Skip to main content

check_value_range

Function check_value_range 

Source
pub fn check_value_range<W: ZerocopyWord>(
    values: &[W],
    bound: usize,
) -> Result<(), OffsetIntegrityIssue>
Expand description

Verifies every value in values is less than bound.

§Errors

Returns OffsetIntegrityIssue::ValueOutOfRange when a value is at or above bound, and OffsetIntegrityIssue::UsizeOverflow when a word’s value does not fit in usize.

§Performance

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