Skip to main content

position_for_relative_offset

Function position_for_relative_offset 

Source
pub fn position_for_relative_offset(
    entries: &[OffsetIndexEntry],
    target_rel: RelativeOffset,
) -> BytePosition
Expand description

Floor lookup: the byte position of the largest entry with rel <= target_rel.

It returns 0 when the index is empty, and when the target is before the first entry. It runs directly against the borrowed zero-copy slice and builds no owned Vec.