pub struct Enumerate<I> { /* private fields */ }Expand description
Enumerate adapter for value-semantic index pairing.
Trait Implementations§
Source§impl<I> ParallelIterator for Enumerate<I>
impl<I> ParallelIterator for Enumerate<I>
Source§fn drive<C, R>(self, consumer: C) -> R
fn drive<C, R>(self, consumer: C) -> R
§Why this stays sequential (the logical-index boundary)
Pairing an item with its logical index needs the count of items that
precede it in the whole stream, and the non-indexed consumer protocol
does not carry one. Consumer::split_at receives the source’s split
point — left.len() at the source being divided — which equals the
logical offset only when nothing between the source and this adapter
changes the element count. A filter below invalidates it, and the
consumer cannot tell the two cases apart, so a shard handed that number
as a base index would silently emit wrong indices for exactly the chains
where it matters. No consumer in the tree reads the index today, which
is why the mismatch is currently latent rather than a live defect.
Supplying a true logical offset means an indexed producer boundary that
knows each shard’s position in the logical stream — the change recorded
as the indexed adapter model in the Rayon adapter surface audit, not a
consumer this adapter can push itself into. positions,
Map::positions, and the borrowed position stream stay sequential for
this same reason, as do take, skip, and step_by, whose retained
items are a function of that same absent offset.
Source§type Item = (usize, <I as ParallelIterator>::Item)
type Item = (usize, <I as ParallelIterator>::Item)
Source§fn seq_items(self) -> Vec<Self::Item>
fn seq_items(self) -> Vec<Self::Item>
Source§fn seq_items_window(self, skip: usize, take: Option<usize>) -> Vec<Self::Item>
fn seq_items_window(self, skip: usize, take: Option<usize>) -> Vec<Self::Item>
Source§fn seq_iter(self) -> impl Iterator<Item = Self::Item>
fn seq_iter(self) -> impl Iterator<Item = Self::Item>
Source§fn seq_try_fold<T, B, F>(self, init: T, fold_fn: F) -> ControlFlow<B, T>
fn seq_try_fold<T, B, F>(self, init: T, fold_fn: F) -> ControlFlow<B, T>
ControlFlow::Break. Read moreSource§fn seq_fold<T, F>(self, init: T, fold_fn: F) -> T
fn seq_fold<T, F>(self, init: T, fold_fn: F) -> T
Source§fn seq_items_reversed(self) -> Vec<Self::Item>
fn seq_items_reversed(self) -> Vec<Self::Item>
Source§fn seq_items_reversed_prefix(self, count: usize) -> Vec<Self::Item>
fn seq_items_reversed_prefix(self, count: usize) -> Vec<Self::Item>
Source§fn map<F, R>(self, map_fn: F) -> Map<Self, F>
fn map<F, R>(self, map_fn: F) -> Map<Self, F>
Source§fn map_with<T, F, R>(self, init: T, map_fn: F) -> MapWith<Self, T, F>
fn map_with<T, F, R>(self, init: T, map_fn: F) -> MapWith<Self, T, F>
Source§fn map_init<Init, T, F, R>(
self,
init: Init,
map_fn: F,
) -> MapInit<Self, Init, F>
fn map_init<Init, T, F, R>( self, init: Init, map_fn: F, ) -> MapInit<Self, Init, F>
Source§fn update<F>(self, update_fn: F) -> Update<Self, F>
fn update<F>(self, update_fn: F) -> Update<Self, F>
Source§fn filter<F>(self, filter_fn: F) -> Filter<Self, F>
fn filter<F>(self, filter_fn: F) -> Filter<Self, F>
Source§fn inspect<F>(self, inspect_fn: F) -> Inspect<Self, F>
fn inspect<F>(self, inspect_fn: F) -> Inspect<Self, F>
Source§fn panic_fuse(self) -> PanicFuse<Self>
fn panic_fuse(self) -> PanicFuse<Self>
Source§fn filter_map<F, R>(self, filter_map_fn: F) -> FilterMap<Self, F>
fn filter_map<F, R>(self, filter_map_fn: F) -> FilterMap<Self, F>
Source§fn while_some<T>(self) -> WhileSome<Self>
fn while_some<T>(self) -> WhileSome<Self>
Source§fn flat_map<F, U>(self, flat_map_fn: F) -> FlatMap<Self, F>
fn flat_map<F, U>(self, flat_map_fn: F) -> FlatMap<Self, F>
Source§fn flat_map_iter<F, U>(self, flat_map_fn: F) -> FlatMap<Self, F>
fn flat_map_iter<F, U>(self, flat_map_fn: F) -> FlatMap<Self, F>
Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn flatten_iter(self) -> Flatten<Self>
fn flatten_iter(self) -> Flatten<Self>
Source§fn enumerate(self) -> Enumerate<Self>
fn enumerate(self) -> Enumerate<Self>
Source§fn zip<J>(self, other: J) -> Zip<Self, J>
fn zip<J>(self, other: J) -> Zip<Self, J>
Source§fn zip_eq<J>(self, other: J) -> ZipEq<Self, J>
fn zip_eq<J>(self, other: J) -> ZipEq<Self, J>
Source§fn take(self, count: usize) -> Take<Self>
fn take(self, count: usize) -> Take<Self>
count elements from the logical sequence prefix.Source§fn take_any(self, count: usize) -> Take<Self>
fn take_any(self, count: usize) -> Take<Self>
count items from this non-indexed deterministic stream.Source§fn skip(self, count: usize) -> Skip<Self>
fn skip(self, count: usize) -> Skip<Self>
count elements from the logical sequence prefix.Source§fn skip_any(self, count: usize) -> Skip<Self>
fn skip_any(self, count: usize) -> Skip<Self>
count items from this non-indexed deterministic stream.Source§fn take_any_while<F>(self, predicate: F) -> TakeAnyWhile<Self, F>
fn take_any_while<F>(self, predicate: F) -> TakeAnyWhile<Self, F>
predicate returns true.Source§fn skip_any_while<F>(self, predicate: F) -> SkipAnyWhile<Self, F>
fn skip_any_while<F>(self, predicate: F) -> SkipAnyWhile<Self, F>
predicate returns true.Source§fn chain<J>(self, other: J) -> Chain<Self, J>
fn chain<J>(self, other: J) -> Chain<Self, J>
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
Source§fn chunks(self, chunk_size: usize) -> Chunks<Self>
fn chunks(self, chunk_size: usize) -> Chunks<Self>
Source§fn copied<'data, T>(self) -> Copied<Self>
fn copied<'data, T>(self) -> Copied<Self>
Source§fn cloned<'data, T>(self) -> Cloned<Self>
fn cloned<'data, T>(self) -> Cloned<Self>
Source§fn reduce<F>(self, reduce_fn: F) -> Option<Self::Item>
fn reduce<F>(self, reduce_fn: F) -> Option<Self::Item>
Source§fn collect_vec_list(self) -> LinkedList<Vec<Self::Item>>
fn collect_vec_list(self) -> LinkedList<Vec<Self::Item>>
Source§fn partition<C, F>(self, predicate: F) -> (C, C)
fn partition<C, F>(self, predicate: F) -> (C, C)
Source§fn partition_map<A, B, P, L, R>(self, predicate: P) -> (A, B)
fn partition_map<A, B, P, L, R>(self, predicate: P) -> (A, B)
Either values into two collections while preserving side-local order.Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
Source§fn sequential(self) -> SequentialAdapter<Self>
fn sequential(self) -> SequentialAdapter<Self>
Source§fn find_first<F>(self, predicate: F) -> Option<Self::Item>
fn find_first<F>(self, predicate: F) -> Option<Self::Item>
Source§fn find_last<F>(self, predicate: F) -> Option<Self::Item>
fn find_last<F>(self, predicate: F) -> Option<Self::Item>
Source§fn position_first<F>(self, predicate: F) -> Option<usize>
fn position_first<F>(self, predicate: F) -> Option<usize>
Source§fn position_any<F>(self, predicate: F) -> Option<usize>
fn position_any<F>(self, predicate: F) -> Option<usize>
Source§fn position_last<F>(self, predicate: F) -> Option<usize>
fn position_last<F>(self, predicate: F) -> Option<usize>
Source§fn positions<F>(self, predicate: F) -> Positions<Self, F>
fn positions<F>(self, predicate: F) -> Positions<Self, F>
Source§fn find_map_first<F, R>(self, map_fn: F) -> Option<R>
fn find_map_first<F, R>(self, map_fn: F) -> Option<R>
Source§fn find_map_any<F, R>(self, map_fn: F) -> Option<R>
fn find_map_any<F, R>(self, map_fn: F) -> Option<R>
Source§fn find_map_last<F, R>(self, map_fn: F) -> Option<R>
fn find_map_last<F, R>(self, map_fn: F) -> Option<R>
Source§fn for_each_with<T, F>(self, init: T, op: F)
fn for_each_with<T, F>(self, init: T, op: F)
Source§fn for_each_init<Init, T, F>(self, init: Init, op: F)
fn for_each_init<Init, T, F>(self, init: Init, op: F)
Source§fn try_for_each<F, E>(self, op: F) -> Result<(), E>
fn try_for_each<F, E>(self, op: F) -> Result<(), E>
Source§fn try_for_each_with<T, F, E>(self, init: T, op: F) -> Result<(), E>
fn try_for_each_with<T, F, E>(self, init: T, op: F) -> Result<(), E>
Source§fn try_for_each_init<Init, T, F, E>(self, init: Init, op: F) -> Result<(), E>
fn try_for_each_init<Init, T, F, E>(self, init: Init, op: F) -> Result<(), E>
Source§fn reduce_with<F>(self, reduce_fn: F) -> Option<Self::Item>
fn reduce_with<F>(self, reduce_fn: F) -> Option<Self::Item>
Source§fn try_reduce<Identity, F, T, E>(
self,
identity: Identity,
reduce_fn: F,
) -> Result<T, E>
fn try_reduce<Identity, F, T, E>( self, identity: Identity, reduce_fn: F, ) -> Result<T, E>
Source§fn sum<S>(self) -> S
fn sum<S>(self) -> S
Iterator::sum
invocation. Read moreSource§fn sum_reassociated<S>(self) -> S
fn sum_reassociated<S>(self) -> S
Source§fn product<P>(self) -> P
fn product<P>(self) -> P
Iterator::product invocation. Read more