pub fn budget<Item, Iter, Size>(
items: Iter,
limit: usize,
size: Size,
) -> impl Iterator<Item = Result<Item, Item>>Expand description
Marks each item, in order, Ok while its size fits within limit together
with the items kept before it, and Err otherwise.
An item that does not fit is skipped rather than ending the walk, so a later smaller item may still be kept. The selection depends only on the sizes and their order.