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