pub struct GlobalExecutorConfig { /* private fields */ }
Expand description
Configuration to init the thread pool for the multi-threaded global executor.
Implementations§
source§impl GlobalExecutorConfig
impl GlobalExecutorConfig
sourcepub fn with_env_var(self, env_var: &'static str) -> Self
pub fn with_env_var(self, env_var: &'static str) -> Self
Use the specified environment variable to find the number of threads to spawn.
sourcepub fn with_min_threads(self, min_threads: usize) -> Self
pub fn with_min_threads(self, min_threads: usize) -> Self
Use the specified value as the minimum number of threads.
sourcepub fn with_max_threads(self, max_threads: usize) -> Self
pub fn with_max_threads(self, max_threads: usize) -> Self
Use the specified value as the maximum number of threads for async tasks.
To limit the maximum number of threads for blocking tasks, please use the
BLOCKING_MAX_THREADS
environment variable.
Trait Implementations§
source§impl Debug for GlobalExecutorConfig
impl Debug for GlobalExecutorConfig
source§impl Default for GlobalExecutorConfig
impl Default for GlobalExecutorConfig
source§fn default() -> GlobalExecutorConfig
fn default() -> GlobalExecutorConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for GlobalExecutorConfig
impl Send for GlobalExecutorConfig
impl Sync for GlobalExecutorConfig
impl Unpin for GlobalExecutorConfig
impl !UnwindSafe for GlobalExecutorConfig
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