pub struct RuntimeBuilder { /* private fields */ }Expand description
Configures a Runtime.
Defaults to single-threaded (1 worker). Call worker_threads to opt into
multi-threaded work-stealing mode.
Implementations§
Source§impl RuntimeBuilder
impl RuntimeBuilder
Sourcepub fn thread_per_core(self) -> Self
pub fn thread_per_core(self) -> Self
Use thread-per-core threading model (single-threaded, default).
Sourcepub fn worker_threads(self, n: usize) -> Self
pub fn worker_threads(self, n: usize) -> Self
Set the number of worker threads for multi-threaded work-stealing mode.
n = 1: single-threaded (same as default)n > 1: spawns N-1 background threads; main thread is worker 0
§Panics
Panics if n == 0.
Sourcepub fn enable_time(self) -> Self
pub fn enable_time(self) -> Self
Enable the timer wheel (no-op: always enabled).
Auto Trait Implementations§
impl Freeze for RuntimeBuilder
impl RefUnwindSafe for RuntimeBuilder
impl Send for RuntimeBuilder
impl Sync for RuntimeBuilder
impl Unpin for RuntimeBuilder
impl UnsafeUnpin for RuntimeBuilder
impl UnwindSafe for RuntimeBuilder
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