Skip to main content

end_position_for

Function end_position_for 

Source
pub fn end_position_for(
    start_position: BytePosition,
    segment_size: u32,
    max_bytes: usize,
) -> Option<BytePosition>
Expand description

Computes the inclusive end_position for a remote byte-range fetch.

It returns None, which means read to the end of the segment, when start_position plus max_bytes would reach or pass segment_size. In every other case it returns the inclusive last byte to read.