Expand description
Data structures that can be filtered and filter-mapped in parallel.
§Examples
use fp_library::{
brands::*,
functions::*,
};
let v = vec![1, 2, 3, 4, 5];
let result: Vec<i32> =
par_filter_map::<VecBrand, _, _>(|x: i32| if x % 2 == 0 { Some(x * 10) } else { None }, v);
assert_eq!(result, vec![20, 40]);Traits§
- ParFilterable
- A type class for data structures that can be filtered and filter-mapped in parallel.
Functions§
- par_
filter - Filters a data structure in parallel, retaining only elements satisfying
f. - par_
filter_ map - Maps and filters a data structure in parallel, discarding elements for which
freturnsNone.