pub struct Walk<'a> { /* private fields */ }Expand description
A cursor over the members that only ever moves forward.
Intset::iter is enough to read a set out, and it is not enough to merge
two of them, because a merge needs to skip. Intersecting a set of ten with a
set of a million should touch ten members of the big one and not a million,
and that is Walk::seek, which jumps to the first member at or past a
value instead of stepping to it.
Forward only, and that is the whole reason it is worth having. A cursor that could go backwards would have to binary search the entire set on every seek. This one searches from where it already is, so a merge that walks two sets in lockstep pays one comparison a member in the common case and only searches when it actually skipped something.
Stepping is a pointer step and nothing else, which is what makes a merge a
different order of cost from a probe. setops.rs explains what that buys and
has the numbers.