Skip to main content

checked_position

Function checked_position 

Source
fn checked_position(index: usize) -> Result<u32>
Expand description

Converts a 0-based index to a 1-based position for storage.

Returns an error if the result would overflow u32, which would corrupt the sentinel value (0 means “not present”) used by contains() and remove().