Function pair_with_slice

Source
pub fn pair_with_slice<'iter, 'pairs, I, Item, P>(
    iter: I,
    pair_with: &'pairs [P],
) -> impl Iterator<Item = Result<(&'pairs P, Item), IndexIsOutOfBounds>> + 'iter
where I: IntoIterator<Item = (usize, Item)> + 'iter, Item: 'iter, 'pairs: 'iter,
Expand description

Maps supplied iterator and attempts to pair each item with an item from the slice which has provided index. Returns Err containing an invalid index in case slice length is exceeded.