pub enum ThreadingSettings {
SingleThreaded,
MultithreadedDefault,
ExplicitThreadsCount {
log_threads: usize,
},
}
Expand description
How many threads to use (threads number is a power of 2).
Variants§
SingleThreaded
Use a single thread for calculations.
MultithreadedDefault
Use the default number of threads based on the number of cores.
ExplicitThreadsCount
Explicitly set the logarithm of number of threads.
Implementations§
source§impl ThreadingSettings
impl ThreadingSettings
sourcepub fn log_threads_count(&self) -> usize
pub fn log_threads_count(&self) -> usize
Get the log2 of the number of threads to use.
sourcepub fn is_multithreaded(&self) -> bool
pub fn is_multithreaded(&self) -> bool
Check if settings imply multithreading.
Trait Implementations§
source§impl Clone for ThreadingSettings
impl Clone for ThreadingSettings
source§fn clone(&self) -> ThreadingSettings
fn clone(&self) -> ThreadingSettings
Returns a copy of the value. Read more
1.6.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ThreadingSettings
impl Debug for ThreadingSettings
source§impl Default for ThreadingSettings
impl Default for ThreadingSettings
source§fn default() -> ThreadingSettings
fn default() -> ThreadingSettings
Returns the “default value” for a type. Read more
impl Copy for ThreadingSettings
Auto Trait Implementations§
impl Freeze for ThreadingSettings
impl RefUnwindSafe for ThreadingSettings
impl Send for ThreadingSettings
impl Sync for ThreadingSettings
impl Unpin for ThreadingSettings
impl UnwindSafe for ThreadingSettings
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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