pub trait IndexedParallelIterator: ParallelIterator {
// Required method
fn len(&self) -> usize;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn collect_into_vec(self, target: &mut Vec<Self::Item>) { ... }
fn unzip_into_vecs<A, B>(self, left: &mut Vec<A>, right: &mut Vec<B>)
where Self: ParallelIterator<Item = (A, B)>,
A: Send,
B: Send { ... }
fn interleave<J>(
self,
other: J,
) -> Interleave<Self, <J as IntoParallelIterator>::Iter>
where J: IntoParallelIterator<Item = Self::Item>,
<J as IntoParallelIterator>::Iter: IndexedParallelIterator<Item = Self::Item>,
Self::Item: Sync + 'static { ... }
fn interleave_shortest<J>(
self,
other: J,
) -> InterleaveShortest<Self, <J as IntoParallelIterator>::Iter>
where J: IntoParallelIterator<Item = Self::Item>,
<J as IntoParallelIterator>::Iter: IndexedParallelIterator<Item = Self::Item>,
Self::Item: Sync + 'static { ... }
fn step_by(self, step: usize) -> StepBy<Self>
where Self::Item: Sync + 'static { ... }
fn by_exponential_blocks(self) -> ExponentialBlocks<Self>
where Self::Item: Sync + 'static { ... }
fn by_uniform_blocks(self, block_size: usize) -> UniformBlocks<Self>
where Self::Item: Sync + 'static { ... }
}Expand description
Exact-size boundary for Moirai’s bounded Rayon-style indexed source subset.
This trait deliberately covers source iterators with known cardinality. It does not claim Rayon’s full indexed producer/consumer adapter model.
Required Methods§
Provided Methods§
Sourcefn collect_into_vec(self, target: &mut Vec<Self::Item>)
fn collect_into_vec(self, target: &mut Vec<Self::Item>)
Move all items into caller-provided storage.
The destination vector is cleared but keeps its allocation, matching the bounded source contract for exact-size streams without requiring item cloning or allocating a second output vector.
Sourcefn unzip_into_vecs<A, B>(self, left: &mut Vec<A>, right: &mut Vec<B>)
fn unzip_into_vecs<A, B>(self, left: &mut Vec<A>, right: &mut Vec<B>)
Split pair items into caller-provided left and right storage.
Both destination vectors are cleared but keep their allocations. Pair values are moved into their target sides exactly once, preserving the bounded exact-size source contract without cloning either side.
Sourcefn interleave<J>(
self,
other: J,
) -> Interleave<Self, <J as IntoParallelIterator>::Iter>where
J: IntoParallelIterator<Item = Self::Item>,
<J as IntoParallelIterator>::Iter: IndexedParallelIterator<Item = Self::Item>,
Self::Item: Sync + 'static,
fn interleave<J>(
self,
other: J,
) -> Interleave<Self, <J as IntoParallelIterator>::Iter>where
J: IntoParallelIterator<Item = Self::Item>,
<J as IntoParallelIterator>::Iter: IndexedParallelIterator<Item = Self::Item>,
Self::Item: Sync + 'static,
Alternately yield items from this source and another exact-size source.
Values are moved from both sources into one logical stream. When one side is exhausted, remaining values from the other side are yielded.
Sourcefn interleave_shortest<J>(
self,
other: J,
) -> InterleaveShortest<Self, <J as IntoParallelIterator>::Iter>where
J: IntoParallelIterator<Item = Self::Item>,
<J as IntoParallelIterator>::Iter: IndexedParallelIterator<Item = Self::Item>,
Self::Item: Sync + 'static,
fn interleave_shortest<J>(
self,
other: J,
) -> InterleaveShortest<Self, <J as IntoParallelIterator>::Iter>where
J: IntoParallelIterator<Item = Self::Item>,
<J as IntoParallelIterator>::Iter: IndexedParallelIterator<Item = Self::Item>,
Self::Item: Sync + 'static,
Alternately yield items until the shorter exact-size source is consumed.
This matches Rayon’s indexed boundary: if the left source is longer, one trailing left item is retained after the final right item.
Sourcefn step_by(self, step: usize) -> StepBy<Self>
fn step_by(self, step: usize) -> StepBy<Self>
Yield every stepth item from an exact-size source.
The step size must be non-zero. Skipped items remain owned by the consumed source iterator and are dropped exactly once.
Sourcefn by_exponential_blocks(self) -> ExponentialBlocks<Self>
fn by_exponential_blocks(self) -> ExponentialBlocks<Self>
Convert this exact-size source into value-preserving exponential blocks.
This bounded adapter preserves logical item order and exposes Rayon’s block-hint API surface. It does not claim Rayon’s full indexed producer/consumer block-splitting scheduler model.
Sourcefn by_uniform_blocks(self, block_size: usize) -> UniformBlocks<Self>
fn by_uniform_blocks(self, block_size: usize) -> UniformBlocks<Self>
Convert this exact-size source into value-preserving uniform blocks.
The block size must be non-zero. This bounded adapter validates the block-size contract and preserves logical item order without claiming Rayon’s full block-splitting producer model.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".