1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/// Result of a `next_id_and_value` call on a concurrent iterator which contains two bits of information:
/// * `idx`: index of the element in the iterator.
/// * `value`: of the element.
#[derive(Debug)]
pub struct Next<T> {
    /// Index of the element in the iterator.
    pub idx: usize,
    /// Value of the element.
    pub value: T,
}

/// A trait representing return types of a `next_chunk` call on a concurrent iterator.
pub struct NextChunk<T, Iter>
where
    Iter: ExactSizeIterator<Item = T>,
{
    /// The index of the first element to be yielded by the `values` iterator.
    pub begin_idx: usize,

    /// Elements in the obtained chunk.
    pub values: Iter,
}