collect_until

Function collect_until 

Source
pub fn collect_until<I>(
    it: I,
    max: NonZeroUsize,
) -> Option<(Vec<I::Item>, usize)>
where I: Iterator,
Expand description

Gather the first N items, and provide the count of the remaining items. The max count cannot be zero as that’s a pathological case.