Struct MultiZip
struct MultiZip<T> { ... }
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!;
Implementations
impl<A> IndexedParallelIterator for MultiZip<(A)>
fn drive<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: Consumer<<Self as >::Item>fn len(self: &Self) -> usizefn with_producer<CB>(self: Self, callback: CB) -> <CB as >::Output where CB: ProducerCallback<<Self as >::Item>
impl<A> ParallelIterator for MultiZip<(A)>
fn drive_unindexed<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: UnindexedConsumer<<Self as >::Item>fn opt_len(self: &Self) -> Option<usize>
impl<A, B> IndexedParallelIterator for MultiZip<(A, B)>
fn drive<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: Consumer<<Self as >::Item>fn len(self: &Self) -> usizefn with_producer<CB>(self: Self, callback: CB) -> <CB as >::Output where CB: ProducerCallback<<Self as >::Item>
impl<A, B> ParallelIterator for MultiZip<(A, B)>
fn drive_unindexed<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: UnindexedConsumer<<Self as >::Item>fn opt_len(self: &Self) -> Option<usize>
impl<A, B, C> IndexedParallelIterator for MultiZip<(A, B, C)>
fn drive<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: Consumer<<Self as >::Item>fn len(self: &Self) -> usizefn with_producer<CB>(self: Self, callback: CB) -> <CB as >::Output where CB: ProducerCallback<<Self as >::Item>
impl<A, B, C> ParallelIterator for MultiZip<(A, B, C)>
fn drive_unindexed<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: UnindexedConsumer<<Self as >::Item>fn opt_len(self: &Self) -> Option<usize>
impl<A, B, C, D> IndexedParallelIterator for MultiZip<(A, B, C, D)>
fn drive<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: Consumer<<Self as >::Item>fn len(self: &Self) -> usizefn with_producer<CB>(self: Self, callback: CB) -> <CB as >::Output where CB: ProducerCallback<<Self as >::Item>
impl<A, B, C, D> ParallelIterator for MultiZip<(A, B, C, D)>
fn drive_unindexed<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: UnindexedConsumer<<Self as >::Item>fn opt_len(self: &Self) -> Option<usize>
impl<A, B, C, D, E> IndexedParallelIterator for MultiZip<(A, B, C, D, E)>
fn drive<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: Consumer<<Self as >::Item>fn len(self: &Self) -> usizefn with_producer<CB>(self: Self, callback: CB) -> <CB as >::Output where CB: ProducerCallback<<Self as >::Item>
impl<A, B, C, D, E> ParallelIterator for MultiZip<(A, B, C, D, E)>
fn drive_unindexed<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: UnindexedConsumer<<Self as >::Item>fn opt_len(self: &Self) -> Option<usize>
impl<A, B, C, D, E, F> IndexedParallelIterator for MultiZip<(A, B, C, D, E, F)>
fn drive<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: Consumer<<Self as >::Item>fn len(self: &Self) -> usizefn with_producer<CB>(self: Self, callback: CB) -> <CB as >::Output where CB: ProducerCallback<<Self as >::Item>
impl<A, B, C, D, E, F> ParallelIterator for MultiZip<(A, B, C, D, E, F)>
fn drive_unindexed<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: UnindexedConsumer<<Self as >::Item>fn opt_len(self: &Self) -> Option<usize>
impl<A, B, C, D, E, F, G> IndexedParallelIterator for MultiZip<(A, B, C, D, E, F, G)>
fn drive<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: Consumer<<Self as >::Item>fn len(self: &Self) -> usizefn with_producer<CB>(self: Self, callback: CB) -> <CB as >::Output where CB: ProducerCallback<<Self as >::Item>
impl<A, B, C, D, E, F, G> ParallelIterator for MultiZip<(A, B, C, D, E, F, G)>
fn drive_unindexed<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: UnindexedConsumer<<Self as >::Item>fn opt_len(self: &Self) -> Option<usize>
impl<A, B, C, D, E, F, G, H> IndexedParallelIterator for MultiZip<(A, B, C, D, E, F, G, H)>
fn drive<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: Consumer<<Self as >::Item>fn len(self: &Self) -> usizefn with_producer<CB>(self: Self, callback: CB) -> <CB as >::Output where CB: ProducerCallback<<Self as >::Item>
impl<A, B, C, D, E, F, G, H> ParallelIterator for MultiZip<(A, B, C, D, E, F, G, H)>
fn drive_unindexed<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: UnindexedConsumer<<Self as >::Item>fn opt_len(self: &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)>
fn drive<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: Consumer<<Self as >::Item>fn len(self: &Self) -> usizefn with_producer<CB>(self: Self, callback: CB) -> <CB as >::Output where CB: ProducerCallback<<Self as >::Item>
impl<A, B, C, D, E, F, G, H, I> ParallelIterator for MultiZip<(A, B, C, D, E, F, G, H, I)>
fn drive_unindexed<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: UnindexedConsumer<<Self as >::Item>fn opt_len(self: &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)>
fn drive<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: Consumer<<Self as >::Item>fn len(self: &Self) -> usizefn with_producer<CB>(self: Self, callback: CB) -> <CB as >::Output where CB: ProducerCallback<<Self as >::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)>
fn drive_unindexed<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: UnindexedConsumer<<Self as >::Item>fn opt_len(self: &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)>
fn drive<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: Consumer<<Self as >::Item>fn len(self: &Self) -> usizefn with_producer<CB>(self: Self, callback: CB) -> <CB as >::Output where CB: ProducerCallback<<Self as >::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)>
fn drive_unindexed<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: UnindexedConsumer<<Self as >::Item>fn opt_len(self: &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)>
fn drive<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: Consumer<<Self as >::Item>fn len(self: &Self) -> usizefn with_producer<CB>(self: Self, callback: CB) -> <CB as >::Output where CB: ProducerCallback<<Self as >::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)>
fn drive_unindexed<CONSUMER>(self: Self, consumer: CONSUMER) -> <CONSUMER as >::Result where CONSUMER: UnindexedConsumer<<Self as >::Item>fn opt_len(self: &Self) -> Option<usize>
impl<T> Any for MultiZip<T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for MultiZip<T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for MultiZip<T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for MultiZip<T>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> Freeze for MultiZip<T>
impl<T> From for MultiZip<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> IntoParallelIterator for MultiZip<T>
fn into_par_iter(self: Self) -> T
impl<T> Pointable for MultiZip<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> RefUnwindSafe for MultiZip<T>
impl<T> Send for MultiZip<T>
impl<T> Sync for MultiZip<T>
impl<T> ToOwned for MultiZip<T>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> Unpin for MultiZip<T>
impl<T> UnsafeUnpin for MultiZip<T>
impl<T> UnwindSafe for MultiZip<T>
impl<T, U> Into for MultiZip<T>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for MultiZip<T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for MultiZip<T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T: $crate::clone::Clone> Clone for MultiZip<T>
fn clone(self: &Self) -> MultiZip<T>
impl<T: $crate::fmt::Debug> Debug for MultiZip<T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result