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§

source

fn len(&self) -> usize

Returns the exact remaining length of the concurrent iterator.

source

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 a crate::NextManyExact which contains the following information:
    • begin_idx: the index of the first element to be yielded by the values iterator.
    • values: an ExactSizeIterator with known len which is guaranteed to be positive and less than or equal to chunk_size.

Provided Methods§

source

fn is_empty(&self) -> bool

Returns true if the iterator is empty.

Object Safety§

This trait is not object safe.

Implementors§