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.
(
iter: I,
pair_with: &'pairs [P],
)
| 21 | /// Maps supplied iterator and attempts to pair each item with an item from the slice which has provided index. |
| 22 | /// Returns `Err` containing an invalid index in case slice length is exceeded. |
| 23 | pub fn pair_with_slice<'iter, 'pairs, I, Item, P>( |
| 24 | iter: I, |
| 25 | pair_with: &'pairs [P], |
| 26 | ) -> impl Iterator<Item = Result<(&'pairs P, Item), IndexIsOutOfBounds>> + 'iter |
| 27 | where |
| 28 | 'pairs: 'iter, |
| 29 | I: IntoIterator<Item = (usize, Item)> + 'iter, |
| 30 | Item: 'iter, |
| 31 | { |
| 32 | try_pair_with_slice(iter.into_iter().map(Ok), pair_with) |
| 33 | } |
| 34 | |
| 35 | /// Ensures that the given iterator satisfies provided validator for each item. |
| 36 | /// In case of an error, `Err(V::Failure)` will be emitted. |
no test coverage detected