pub struct ThreadPoolConfig {
pub num_threads: Option<usize>,
pub stack_size: Option<usize>,
pub thread_name_prefix: String,
pub pin_threads: bool,
pub priority: ThreadPriority,
}Expand description
Thread pool configuration for parallel operations
Fields§
§num_threads: Option<usize>Number of threads (None = auto-detect)
stack_size: Option<usize>Stack size per thread in bytes
thread_name_prefix: StringThread name prefix
pin_threads: boolEnable thread pinning (CPU affinity)
priority: ThreadPriorityPriority level for threads
Implementations§
Source§impl ThreadPoolConfig
impl ThreadPoolConfig
Sourcepub fn with_num_threads(self, num: usize) -> Self
pub fn with_num_threads(self, num: usize) -> Self
Set number of threads
Sourcepub fn with_stack_size(self, size: usize) -> Self
pub fn with_stack_size(self, size: usize) -> Self
Set stack size
Sourcepub fn with_name_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_name_prefix(self, prefix: impl Into<String>) -> Self
Set thread name prefix
Sourcepub fn with_pin_threads(self, pin: bool) -> Self
pub fn with_pin_threads(self, pin: bool) -> Self
Enable thread pinning
Sourcepub fn with_priority(self, priority: ThreadPriority) -> Self
pub fn with_priority(self, priority: ThreadPriority) -> Self
Set thread priority
Trait Implementations§
Source§impl Clone for ThreadPoolConfig
impl Clone for ThreadPoolConfig
Source§fn clone(&self) -> ThreadPoolConfig
fn clone(&self) -> ThreadPoolConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ThreadPoolConfig
impl Debug for ThreadPoolConfig
Auto Trait Implementations§
impl Freeze for ThreadPoolConfig
impl RefUnwindSafe for ThreadPoolConfig
impl Send for ThreadPoolConfig
impl Sync for ThreadPoolConfig
impl Unpin for ThreadPoolConfig
impl UnsafeUnpin for ThreadPoolConfig
impl UnwindSafe for ThreadPoolConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().