pub struct RuntimeConfig {
pub worker_threads: Option<usize>,
pub thread_name: String,
pub enable_io: bool,
pub enable_time: bool,
pub max_blocking_threads: usize,
}Expand description
Configuration for the async runtime
Fields§
§worker_threads: Option<usize>Number of worker threads (None = number of CPU cores)
thread_name: StringName prefix for worker threads
enable_io: boolEnable I/O driver
enable_time: boolEnable time driver
max_blocking_threads: usizeMaximum blocking threads
Implementations§
Source§impl RuntimeConfig
impl RuntimeConfig
Sourcepub fn new() -> RuntimeConfig
pub fn new() -> RuntimeConfig
Create a new runtime configuration
Sourcepub fn with_worker_threads(self, threads: usize) -> RuntimeConfig
pub fn with_worker_threads(self, threads: usize) -> RuntimeConfig
Set the number of worker threads
Sourcepub fn with_thread_name(self, name: impl Into<String>) -> RuntimeConfig
pub fn with_thread_name(self, name: impl Into<String>) -> RuntimeConfig
Set the thread name prefix
Trait Implementations§
Source§impl Clone for RuntimeConfig
impl Clone for RuntimeConfig
Source§fn clone(&self) -> RuntimeConfig
fn clone(&self) -> RuntimeConfig
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 RuntimeConfig
impl Debug for RuntimeConfig
Source§impl Default for RuntimeConfig
impl Default for RuntimeConfig
Source§fn default() -> RuntimeConfig
fn default() -> RuntimeConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RuntimeConfig
impl RefUnwindSafe for RuntimeConfig
impl Send for RuntimeConfig
impl Sync for RuntimeConfig
impl Unpin for RuntimeConfig
impl UnsafeUnpin for RuntimeConfig
impl UnwindSafe for RuntimeConfig
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