[−]Function astral::thirdparty::rayon::iter::plumbing::bridge
pub fn bridge<I, C>(
par_iter: I,
consumer: C
) -> <C as Consumer<<I as ParallelIterator>::Item>>::Result where
C: Consumer<<I as ParallelIterator>::Item>,
I: IndexedParallelIterator,
This helper function is used to "connect" a parallel iterator to a
consumer. It will convert the par_iter
into a producer P and
then pull items from P and feed them to consumer
, splitting and
creating parallel threads as needed.
This is useful when you are implementing your own parallel
iterators: it is often used as the definition of the
drive_unindexed
or drive
methods.