Struct itertools::ZipSlices
[−]
[src]
pub struct ZipSlices<T, U> { // some fields omitted }
An iterator which iterates two slices simultaneously.
ZipSlices
acts like a double-ended .zip()
iterator, but more efficiently.
Note that elements past the end of the shortest of the two slices are ignored.
Iterator element type for ZipSlices<T, U>
is (T::Item, U::Item)
. For example,
for a ZipSlices<&'a [A], &'b mut [B]>
, the element type is (&'a A, &'b mut B)
.
Methods
impl<'a, 'b, A, B> ZipSlices<&'a [A], &'b [B]>
fn new(a: &'a [A], b: &'b [B]) -> Self
Create a new ZipSlices
from slices a
and b
.
Act like a double-ended .zip()
iterator, but more efficiently.
Note that elements past the end of the shortest of the two slices are ignored.
impl<T, U> ZipSlices<T, U> where T: Slice, U: Slice
fn from_slices(a: T, b: U) -> Self
Create a new ZipSlices
from slices a
and b
.
Act like a double-ended .zip()
iterator, but more efficiently.
Note that elements past the end of the shortest of the two slices are ignored.