pub struct ParallelOptions {
pub threads: Option<usize>,
}Expand description
Worker-thread policy for the algorithms that have a parallel path.
Fields§
§threads: Option<usize>Number of workers; None uses the Rayon default.
Implementations§
Source§impl ParallelOptions
impl ParallelOptions
Sourcepub const fn new(threads: Option<usize>) -> Self
pub const fn new(threads: Option<usize>) -> Self
Creates options with an optional worker count.
Sourcepub fn install<T, F>(&self, function: F) -> Result<T, String>
pub fn install<T, F>(&self, function: F) -> Result<T, String>
Runs function inside a scoped pool with the requested worker count.
Results are independent of the thread count because the parallel reductions keep a fixed order (AGENTS.md rule 6).
§Errors
Returns a message when the pool cannot be built.
Trait Implementations§
Source§impl Clone for ParallelOptions
impl Clone for ParallelOptions
impl Copy for ParallelOptions
Source§impl Debug for ParallelOptions
impl Debug for ParallelOptions
Source§impl Default for ParallelOptions
impl Default for ParallelOptions
impl Eq for ParallelOptions
Source§impl PartialEq for ParallelOptions
impl PartialEq for ParallelOptions
impl StructuralPartialEq for ParallelOptions
Auto Trait Implementations§
impl Forget for ParallelOptions
impl Freeze for ParallelOptions
impl Move for ParallelOptions
impl RefUnwindSafe for ParallelOptions
impl Send for ParallelOptions
impl Sync for ParallelOptions
impl Unpin for ParallelOptions
impl UnsafeUnpin for ParallelOptions
impl UnwindSafe for ParallelOptions
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