Introduction Link to heading Suppose we need to write a function that computes the next set of numbers in a range and stores them in a slice, as shown below: let pl = RangePl::new(1..12); let mut buffer = [0u64; 4]; pl.next_batch(0, &mut buffer); // returns 4, buffer[..] = [1, 2, 3, 4] pl.next_batch(0, &mut buffer); // returns 4, buffer[..] = [5, 6, 7, 8] pl.next_batch(10, &mut buffer); // returns 2, buffer[0.