pub trait ParallelExt: Parallel {
// Required method
fn maybe_par_idx_raw<I, F>(&mut self, threshold: usize, nodes: I, op: &F)
where I: Items,
F: Send + Sync + Fn(&mut Self, usize, I::Elem);
// Provided methods
fn maybe_par<I, F>(&mut self, threshold: usize, nodes: I, op: F)
where I: IntoItems,
F: Send + Sync + Fn(&mut Self, I::Elem) { ... }
fn maybe_par_idx<I, F>(&mut self, threshold: usize, nodes: I, op: F)
where I: IntoItems,
F: Send + Sync + Fn(&mut Self, usize, I::Elem) { ... }
}
Required Methods§
Sourcefn maybe_par_idx_raw<I, F>(&mut self, threshold: usize, nodes: I, op: &F)
fn maybe_par_idx_raw<I, F>(&mut self, threshold: usize, nodes: I, op: &F)
If you don’t have a special reason, use ParallelExt::maybe_par
or
ParallelExt::maybe_par_idx
instead.
Provided Methods§
Sourcefn maybe_par<I, F>(&mut self, threshold: usize, nodes: I, op: F)
fn maybe_par<I, F>(&mut self, threshold: usize, nodes: I, op: F)
Invoke op
in parallel, if swc_ecma_utils
is compiled with
concurrent feature enabled and nodes.len()
is bigger than threshold.
This configures GLOBALS, while not configuring [HANDLER] nor [HELPERS]
Sourcefn maybe_par_idx<I, F>(&mut self, threshold: usize, nodes: I, op: F)
fn maybe_par_idx<I, F>(&mut self, threshold: usize, nodes: I, op: F)
Invoke op
in parallel, if swc_ecma_utils
is compiled with
concurrent feature enabled and nodes.len()
is bigger than threshold.
This configures GLOBALS, while not configuring [HANDLER] nor [HELPERS]
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.