Skip to main content

check_position_range

Function check_position_range 

Source
pub fn check_position_range(
    path: &str,
    start: usize,
    end: usize,
    size: usize,
) -> ArgumentResult<Range<usize>>
Expand description

Validates a half-open range of boundary positions.

start and end are valid when start <= end <= size. Equal endpoints are accepted and produce an empty range. On success, this function returns the validated start..end range.

ยงErrors

Returns ArgumentErrorKind::IndexRange when start exceeds end or when end exceeds size.