Trait halo2_backend::multicore::TryFoldAndReduce

source ·
pub trait TryFoldAndReduce<T, E> {
    // Required method
    fn try_fold_and_reduce(
        self,
        identity: impl Fn() -> T + Send + Sync,
        fold_op: impl Fn(T, Result<T, E>) -> Result<T, E> + Send + Sync
    ) -> Result<T, E>;
}

Required Methods§

source

fn try_fold_and_reduce( self, identity: impl Fn() -> T + Send + Sync, fold_op: impl Fn(T, Result<T, E>) -> Result<T, E> + Send + Sync ) -> Result<T, E>

Implements iter.try_fold().try_reduce() for rayon::iter::ParallelIterator, falling back on Iterator::try_fold when the multicore feature flag is disabled. The try_fold_and_reduce function can only be called by a iter with Result<T, E> item type because the fold_op must meet the trait bounds of both try_fold and try_reduce from rayon.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T, E, I> TryFoldAndReduce<T, E> for I
where T: Send + Sync, E: Send + Sync, I: ParallelIterator<Item = Result<T, E>>,