pub enum ThreadCount {
AvailableParallelism,
Count(NonZeroUsize),
}Available on crate features
rayon or default-thread-pool only.Expand description
Number of threads to spawn in a thread pool.
Variants§
AvailableParallelism
Spawn the number of threads returned by
std::thread::available_parallelism().
Count(NonZeroUsize)
Spawn the given number of threads.
Implementations§
Source§impl ThreadCount
impl ThreadCount
Sourcepub fn count(self) -> NonZeroUsize
pub fn count(self) -> NonZeroUsize
Resolves the number of threads to spawn.
Trait Implementations§
Source§impl Clone for ThreadCount
impl Clone for ThreadCount
Source§fn clone(&self) -> ThreadCount
fn clone(&self) -> ThreadCount
Returns a duplicate of the value. Read more
1.0.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 ThreadCount
impl Debug for ThreadCount
Source§impl PartialEq for ThreadCount
impl PartialEq for ThreadCount
Source§impl TryFrom<usize> for ThreadCount
impl TryFrom<usize> for ThreadCount
impl Copy for ThreadCount
impl Eq for ThreadCount
impl StructuralPartialEq for ThreadCount
Auto Trait Implementations§
impl Freeze for ThreadCount
impl RefUnwindSafe for ThreadCount
impl Send for ThreadCount
impl Sync for ThreadCount
impl Unpin for ThreadCount
impl UnwindSafe for ThreadCount
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