Skip to main content

Module par_ref_foldable

Module par_ref_foldable 

Source
Expand description

Parallel by-reference foldable.

User story: “I want to fold over a collection by reference in parallel.”

§Examples

use fp_library::{
	brands::VecBrand,
	classes::par_ref_foldable::ParRefFoldable,
};

let v = vec![1, 2, 3];
let result = VecBrand::par_ref_fold_map(|x: &i32| x.to_string(), &v);
assert_eq!(result, "123");

Traits§

ParRefFoldable
Parallel by-reference folding over a structure.

Functions§

par_ref_fold_map
Maps each element by reference to a monoid and combines them in parallel.