Struct MultiZip
pub struct MultiZip<T> { /* private fields */ }
MultiZip is an iterator that zips up a tuple of parallel iterators to
produce tuples of their items.
It is created by calling into_par_iter() on a tuple of types that
implement IntoParallelIterator, or par_iter()/par_iter_mut() with
types that are iterable by reference.
The implementation currently support tuples up to length 12.
Examples
use *;
// This will iterate `r` by mutable reference, like `par_iter_mut()`, while
// ranges are all iterated by value like `into_par_iter()`.
// Note that the zipped iterator is only as long as the shortest input.
let mut r = vec!;
.into_par_iter
.for_each;
assert_eq!;
For a group that should all be iterated by reference, you can use a tuple reference.
use *;
let xs: = .collect;
let ys: = .collect;
let zs: = .collect;
// Reference each input separately with `IntoParallelIterator`:
let r1: = .into_par_iter
.map
.collect;
// Reference them all together with `IntoParallelRefIterator`:
let r2: = .par_iter
.map
.collect;
assert_eq!;
Mutable references to a tuple will work similarly.
use *;
let mut xs: = .collect;
let mut ys: = .collect;
let mut zs = vec!;
// Mutably reference each input separately with `IntoParallelIterator`:
.into_par_iter.for_each;
assert_eq!;
assert_eq!;
assert_eq!;
// Mutably reference them all together with `IntoParallelRefMutIterator`:
let mut tuple = ;
tuple.par_iter_mut.for_each;
assert_eq!;
Trait Implementations
impl<A> IndexedParallelIterator for MultiZip<(A,)>
where
A: IndexedParallelIterator,
fn drive<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl<A> ParallelIterator for MultiZip<(A,)>
where
A: IndexedParallelIterator,
type Item = (<A as ParallelIterator>::Item,);fn drive_unindexed<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<A, B> IndexedParallelIterator for MultiZip<(A, B)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
fn drive<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl<A, B> ParallelIterator for MultiZip<(A, B)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
type Item = (<A as ParallelIterator>::Item, <B as ParallelIterator>::Item);fn drive_unindexed<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<A, B, C> IndexedParallelIterator for MultiZip<(A, B, C)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
fn drive<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl<A, B, C> ParallelIterator for MultiZip<(A, B, C)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
type Item = (<A as ParallelIterator>::Item, <B as ParallelIterator>::Item, <C as ParallelIterator>::Item);fn drive_unindexed<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<A, B, C, D> IndexedParallelIterator for MultiZip<(A, B, C, D)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
fn drive<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl<A, B, C, D> ParallelIterator for MultiZip<(A, B, C, D)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
type Item = (<A as ParallelIterator>::Item, <B as ParallelIterator>::Item, <C as ParallelIterator>::Item, <D as ParallelIterator>::Item);fn drive_unindexed<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<A, B, C, D, E> IndexedParallelIterator for MultiZip<(A, B, C, D, E)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
fn drive<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl<A, B, C, D, E> ParallelIterator for MultiZip<(A, B, C, D, E)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
type Item = (<A as ParallelIterator>::Item, <B as ParallelIterator>::Item, <C as ParallelIterator>::Item, <D as ParallelIterator>::Item, <E as ParallelIterator>::Item);fn drive_unindexed<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<A, B, C, D, E, F> IndexedParallelIterator for MultiZip<(A, B, C, D, E, F)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
fn drive<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl<A, B, C, D, E, F> ParallelIterator for MultiZip<(A, B, C, D, E, F)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
type Item = (<A as ParallelIterator>::Item, <B as ParallelIterator>::Item, <C as ParallelIterator>::Item, <D as ParallelIterator>::Item, <E as ParallelIterator>::Item, <F as ParallelIterator>::Item);fn drive_unindexed<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<A, B, C, D, E, F, G> IndexedParallelIterator for MultiZip<(A, B, C, D, E, F, G)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
G: IndexedParallelIterator,
fn drive<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl<A, B, C, D, E, F, G> ParallelIterator for MultiZip<(A, B, C, D, E, F, G)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
G: IndexedParallelIterator,
type Item = (<A as ParallelIterator>::Item, <B as ParallelIterator>::Item, <C as ParallelIterator>::Item, <D as ParallelIterator>::Item, <E as ParallelIterator>::Item, <F as ParallelIterator>::Item, <G as ParallelIterator>::Item);fn drive_unindexed<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<A, B, C, D, E, F, G, H> IndexedParallelIterator for MultiZip<(A, B, C, D, E, F, G, H)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
G: IndexedParallelIterator,
H: IndexedParallelIterator,
fn drive<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl<A, B, C, D, E, F, G, H> ParallelIterator for MultiZip<(A, B, C, D, E, F, G, H)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
G: IndexedParallelIterator,
H: IndexedParallelIterator,
type Item = (<A as ParallelIterator>::Item, <B as ParallelIterator>::Item, <C as ParallelIterator>::Item, <D as ParallelIterator>::Item, <E as ParallelIterator>::Item, <F as ParallelIterator>::Item, <G as ParallelIterator>::Item, <H as ParallelIterator>::Item);fn drive_unindexed<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<A, B, C, D, E, F, G, H, I> IndexedParallelIterator for MultiZip<(A, B, C, D, E, F, G, H, I)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
G: IndexedParallelIterator,
H: IndexedParallelIterator,
I: IndexedParallelIterator,
fn drive<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl<A, B, C, D, E, F, G, H, I> ParallelIterator for MultiZip<(A, B, C, D, E, F, G, H, I)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
G: IndexedParallelIterator,
H: IndexedParallelIterator,
I: IndexedParallelIterator,
type Item = (<A as ParallelIterator>::Item, <B as ParallelIterator>::Item, <C as ParallelIterator>::Item, <D as ParallelIterator>::Item, <E as ParallelIterator>::Item, <F as ParallelIterator>::Item, <G as ParallelIterator>::Item, <H as ParallelIterator>::Item, <I as ParallelIterator>::Item);fn drive_unindexed<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<A, B, C, D, E, F, G, H, I, J> IndexedParallelIterator for MultiZip<(A, B, C, D, E, F, G, H, I, J)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
G: IndexedParallelIterator,
H: IndexedParallelIterator,
I: IndexedParallelIterator,
J: IndexedParallelIterator,
fn drive<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl<A, B, C, D, E, F, G, H, I, J> ParallelIterator for MultiZip<(A, B, C, D, E, F, G, H, I, J)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
G: IndexedParallelIterator,
H: IndexedParallelIterator,
I: IndexedParallelIterator,
J: IndexedParallelIterator,
type Item = (<A as ParallelIterator>::Item, <B as ParallelIterator>::Item, <C as ParallelIterator>::Item, <D as ParallelIterator>::Item, <E as ParallelIterator>::Item, <F as ParallelIterator>::Item, <G as ParallelIterator>::Item, <H as ParallelIterator>::Item, <I as ParallelIterator>::Item, <J as ParallelIterator>::Item);fn drive_unindexed<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<A, B, C, D, E, F, G, H, I, J, K> IndexedParallelIterator for MultiZip<(A, B, C, D, E, F, G, H, I, J, K)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
G: IndexedParallelIterator,
H: IndexedParallelIterator,
I: IndexedParallelIterator,
J: IndexedParallelIterator,
K: IndexedParallelIterator,
fn drive<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl<A, B, C, D, E, F, G, H, I, J, K> ParallelIterator for MultiZip<(A, B, C, D, E, F, G, H, I, J, K)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
G: IndexedParallelIterator,
H: IndexedParallelIterator,
I: IndexedParallelIterator,
J: IndexedParallelIterator,
K: IndexedParallelIterator,
type Item = (<A as ParallelIterator>::Item, <B as ParallelIterator>::Item, <C as ParallelIterator>::Item, <D as ParallelIterator>::Item, <E as ParallelIterator>::Item, <F as ParallelIterator>::Item, <G as ParallelIterator>::Item, <H as ParallelIterator>::Item, <I as ParallelIterator>::Item, <J as ParallelIterator>::Item, <K as ParallelIterator>::Item);fn drive_unindexed<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<A, B, C, D, E, F, G, H, I, J, K, L> IndexedParallelIterator for MultiZip<(A, B, C, D, E, F, G, H, I, J, K, L)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
G: IndexedParallelIterator,
H: IndexedParallelIterator,
I: IndexedParallelIterator,
J: IndexedParallelIterator,
K: IndexedParallelIterator,
L: IndexedParallelIterator,
fn drive<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl<A, B, C, D, E, F, G, H, I, J, K, L> ParallelIterator for MultiZip<(A, B, C, D, E, F, G, H, I, J, K, L)>
where
A: IndexedParallelIterator,
B: IndexedParallelIterator,
C: IndexedParallelIterator,
D: IndexedParallelIterator,
E: IndexedParallelIterator,
F: IndexedParallelIterator,
G: IndexedParallelIterator,
H: IndexedParallelIterator,
I: IndexedParallelIterator,
J: IndexedParallelIterator,
K: IndexedParallelIterator,
L: IndexedParallelIterator,
type Item = (<A as ParallelIterator>::Item, <B as ParallelIterator>::Item, <C as ParallelIterator>::Item, <D as ParallelIterator>::Item, <E as ParallelIterator>::Item, <F as ParallelIterator>::Item, <G as ParallelIterator>::Item, <H as ParallelIterator>::Item, <I as ParallelIterator>::Item, <J as ParallelIterator>::Item, <K as ParallelIterator>::Item, <L as ParallelIterator>::Item);fn drive_unindexed<CONSUMER>(self, consumer: CONSUMER) -> CONSUMER::Result where CONSUMER: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<T: Clone> Clone for MultiZip<T>
fn clone(&self) -> MultiZip<T>
impl<T: Debug> Debug for MultiZip<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<T> Freeze for MultiZip<T>
where
T: Freeze,
impl<T> RefUnwindSafe for MultiZip<T>
where
T: RefUnwindSafe,
impl<T> Send for MultiZip<T>
where
T: Send,
impl<T> Sync for MultiZip<T>
where
T: Sync,
impl<T> Unpin for MultiZip<T>
where
T: Unpin,
impl<T> UnsafeUnpin for MultiZip<T>
where
T: UnsafeUnpin,
impl<T> UnwindSafe for MultiZip<T>
where
T: UnwindSafe,
Blanket Implementations
impl<T> Any for MultiZip<T>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for MultiZip<T>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for MultiZip<T>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for MultiZip<T>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for MultiZip<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> IntoEither for MultiZip<T>
impl<T> IntoParallelIterator for MultiZip<T>
where
T: ParallelIterator,
type Iter = T;type Item = <T as ParallelIterator>::Item;fn into_par_iter(self) -> T
impl<T> Pointable for MultiZip<T>
const ALIGN: usize = _;type Init = T;unsafe fn init(init: <T as Pointable>::Init) -> usizeunsafe fn deref<'a>(ptr: usize) -> &'a Tunsafe fn deref_mut<'a>(ptr: usize) -> &'a mut Tunsafe fn drop(ptr: usize)
impl<T> ToOwned for MultiZip<T>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for MultiZip<T>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for MultiZip<T>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for MultiZip<T>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>