Skip to main content

slice_relative_ends

Function slice_relative_ends 

Source
pub fn slice_relative_ends<E: IntegerPType>(
    run_ends: &[E],
    offset: usize,
    length: usize,
) -> impl Iterator<Item = usize> + use<'_, E>
Expand description

Yields exclusive run ends relative to a logical slice.

Subtracts offset from each end and clamps it to length. One end is yielded per input run, including zero-length runs at the slice boundaries, so indices still match the values child.

ยงPanics

Panics if offset or length cannot be represented by E, or an input end is before offset.