devela::_dep::rayon::iter::plumbing

Function bridge

pub fn bridge<I, C>(
    par_iter: I,
    consumer: C,
) -> <C as Consumer<<I as ParallelIterator>::Item>>::Result
Available on crate feature dep_rayon only.
Expand description

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.