pub struct Manual<S> { /* private fields */ }Expand description
A strategy wrapper for manually partitioned work.
This disables adaptive serial-vs-parallel policy decisions for operations that callers have already split into partitions.
Implementations§
Source§impl<S> Manual<S>
impl<S> Manual<S>
Sourcepub const fn new(strategy: S, parallelism: NonZeroUsize) -> Self
pub const fn new(strategy: S, parallelism: NonZeroUsize) -> Self
Creates a strategy wrapper for manually partitioned work.
Sourcepub const fn parallelism(&self) -> usize
pub const fn parallelism(&self) -> usize
Returns the parallelism to use for manually partitioned work.
Trait Implementations§
Source§impl<S: Strategy> Strategy for Manual<S>
Available on neither commonware_stability_DELTA nor commonware_stability_EPSILON nor commonware_stability_GAMMA nor commonware_stability_RESERVED.
impl<S: Strategy> Strategy for Manual<S>
Available on neither
commonware_stability_DELTA nor commonware_stability_EPSILON nor commonware_stability_GAMMA nor commonware_stability_RESERVED.Source§fn spawn<F, T>(&self, f: F) -> impl Future<Output = T> + Send + 'static
fn spawn<F, T>(&self, f: F) -> impl Future<Output = T> + Send + 'static
Submit one CPU-bound job to this strategy. Read more
Source§fn run<R, SEQ, PAR>(&self, len: usize, serial: SEQ, parallel: PAR) -> R
fn run<R, SEQ, PAR>(&self, len: usize, serial: SEQ, parallel: PAR) -> R
Runs either a serial or parallel body.
Source§fn fold_init<I, INIT, T, R, ID, F, RD>(
&self,
iter: I,
init: INIT,
identity: ID,
fold_op: F,
reduce_op: RD,
) -> R
fn fold_init<I, INIT, T, R, ID, F, RD>( &self, iter: I, init: INIT, identity: ID, fold_op: F, reduce_op: RD, ) -> R
Reduces a collection to a single value with per-partition initialization. Read more
Source§fn try_fold<I, R, E, ID, F, RD>(
&self,
iter: I,
identity: ID,
fold_op: F,
reduce_op: RD,
) -> Result<R, E>
fn try_fold<I, R, E, ID, F, RD>( &self, iter: I, identity: ID, fold_op: F, reduce_op: RD, ) -> Result<R, E>
Reduces a collection to a single value using a fallible fold operation. Read more
Source§fn map_collect_vec<I, F, T>(&self, iter: I, map_op: F) -> Vec<T>
fn map_collect_vec<I, F, T>(&self, iter: I, map_op: F) -> Vec<T>
Maps each element and collects results into a
Vec. Read moreSource§fn try_map_collect_vec<I, F, T, E>(
&self,
iter: I,
map_op: F,
) -> Result<Vec<T>, E>
fn try_map_collect_vec<I, F, T, E>( &self, iter: I, map_op: F, ) -> Result<Vec<T>, E>
Maps each element with a fallible operation and collects results into a
Vec. Read moreSource§fn map_init_collect_vec<I, INIT, T, F, R>(
&self,
iter: I,
init: INIT,
map_op: F,
) -> Vec<R>
fn map_init_collect_vec<I, INIT, T, F, R>( &self, iter: I, init: INIT, map_op: F, ) -> Vec<R>
Maps each element with per-partition state and collects results into a
Vec. Read moreSource§fn map_init_collect_vec_with_multiplier<I, INIT, T, F, R>(
&self,
iter: I,
multiplier: usize,
init: INIT,
map_op: F,
) -> Vec<R>
fn map_init_collect_vec_with_multiplier<I, INIT, T, F, R>( &self, iter: I, multiplier: usize, init: INIT, map_op: F, ) -> Vec<R>
Maps each element with per-partition state and a per-item work multiplier.
Source§fn map_partition_collect_vec<I, F, K, U>(
&self,
iter: I,
map_op: F,
) -> (Vec<U>, Vec<K>)
fn map_partition_collect_vec<I, F, K, U>( &self, iter: I, map_op: F, ) -> (Vec<U>, Vec<K>)
Maps each element, filtering out
None results and tracking their keys. Read moreSource§fn join<A, B, RA, RB>(&self, a: A, b: B) -> (RA, RB)
fn join<A, B, RA, RB>(&self, a: A, b: B) -> (RA, RB)
Executes two closures, potentially in parallel, and returns both results. Read more
Source§fn sort_by<T, C>(&self, items: &mut [T], compare: C)
fn sort_by<T, C>(&self, items: &mut [T], compare: C)
Sorts a slice with a comparator, preserving the order of equal elements. Read more
Auto Trait Implementations§
impl<S> Freeze for Manual<S>where
S: Freeze,
impl<S> RefUnwindSafe for Manual<S>where
S: RefUnwindSafe,
impl<S> Send for Manual<S>where
S: Send,
impl<S> Sync for Manual<S>where
S: Sync,
impl<S> Unpin for Manual<S>where
S: Unpin,
impl<S> UnsafeUnpin for Manual<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Manual<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more