Skip to main content

next_range

Function next_range 

Source
pub fn next_range(
    committed: &CommittedSet,
    in_flight: &[(u64, u64)],
    size: u64,
    want: u64,
) -> Option<(u64, u64)>
Expand description

The next range to send: the lowest byte of [0, size) that is neither committed nor in in_flight, and from it at most want bytes, ending where the next committed or in-flight range begins. None once every byte is committed or in flight.

want is the chunk size the adaptive strategy names, a multiple of the grid; a range shorter than it either ends at the declared size or at a range that starts on the grid, so the plan stays on the grid.