pub struct ThreadPoolConfig {
pub num_threads: usize,
pub stack_size: Option<usize>,
pub thread_name: Option<String>,
pub idle_timeout: Option<Duration>,
pub max_chunk_size: Option<usize>,
pub min_chunk_size: Option<usize>,
}Expand description
Thread pool configuration
Fields§
§num_threads: usizeNumber of worker threads
stack_size: Option<usize>Thread stack size in bytes
thread_name: Option<String>Thread name prefix
idle_timeout: Option<Duration>Idle timeout for threads
max_chunk_size: Option<usize>Maximum chunk size
min_chunk_size: Option<usize>Minimum chunk size
Implementations§
Source§impl ThreadPoolConfig
impl ThreadPoolConfig
Sourcepub fn num_threads(self, n: usize) -> Self
pub fn num_threads(self, n: usize) -> Self
Set the number of threads
Sourcepub fn stack_size(self, size: usize) -> Self
pub fn stack_size(self, size: usize) -> Self
Set the stack size for threads
Sourcepub fn thread_name(self, name: impl Into<String>) -> Self
pub fn thread_name(self, name: impl Into<String>) -> Self
Set the thread name prefix
Sourcepub fn idle_timeout(self, timeout: Duration) -> Self
pub fn idle_timeout(self, timeout: Duration) -> Self
Set the idle timeout
Sourcepub fn max_chunk_size(self, size: usize) -> Self
pub fn max_chunk_size(self, size: usize) -> Self
Set the maximum chunk size
Sourcepub fn min_chunk_size(self, size: usize) -> Self
pub fn min_chunk_size(self, size: usize) -> Self
Set the minimum chunk size
Sourcepub fn effective_min_chunk_size(&self) -> usize
pub fn effective_min_chunk_size(&self) -> usize
Get effective min chunk size
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§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 UnwindSafe for ThreadPoolConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)