pub trait ExactSizeConcurrentIter: ConcurrentIter {
// Required methods
fn len(&self) -> usize;
fn next_exact_chunk(
&self,
chunk_size: usize
) -> Option<NextManyExact<Self::Item, impl ExactSizeIterator<Item = Self::Item>>>;
// Provided method
fn is_empty(&self) -> bool { ... }
}
Expand description
A concurrent iterator that knows its exact length.
Required Methods§
sourcefn next_exact_chunk(
&self,
chunk_size: usize
) -> Option<NextManyExact<Self::Item, impl ExactSizeIterator<Item = Self::Item>>>
fn next_exact_chunk( &self, chunk_size: usize ) -> Option<NextManyExact<Self::Item, impl ExactSizeIterator<Item = Self::Item>>>
Returns the next chunk with the requested chunk_size
:
- Returns
None
if there are no more elements to yield. - Returns
Some
of acrate::NextManyExact
which contains the following information:begin_idx
: the index of the first element to be yielded by thevalues
iterator.values
: anExactSizeIterator
with knownlen
which is guaranteed to be positive and less than or equal tochunk_size
.
Provided Methods§
Object Safety§
This trait is not object safe.