pub struct RuntimeBuilder { /* private fields */ }Expand description
Implementations§
Source§impl RuntimeBuilder
impl RuntimeBuilder
Sourcepub fn new(threads: usize, name: &str) -> Self
pub fn new(threads: usize, name: &str) -> Self
Create a new builder with the given number of worker threads and runtime name.
Work stealing is enabled by default.
Sourcepub fn work_steal(self, enabled: bool) -> Self
pub fn work_steal(self, enabled: bool) -> Self
Set whether work stealing is enabled.
When true (the default), a tokio multi-thread runtime is used.
When false, a pool of single-threaded tokio runtimes is used instead.
Sourcepub fn blocking_pool_opts(self, opts: BlockingPoolOpts) -> Self
pub fn blocking_pool_opts(self, opts: BlockingPoolOpts) -> Self
Set the BlockingPoolOpts for the runtime’s blocking thread pool.
Sourcepub fn metrics_opts(self, opts: RuntimeMetricsOpts) -> Self
pub fn metrics_opts(self, opts: RuntimeMetricsOpts) -> Self
Set the RuntimeMetricsOpts for the runtime.
Sourcepub fn runtime_opts(self, opts: RuntimeOpts) -> Self
pub fn runtime_opts(self, opts: RuntimeOpts) -> Self
Set the RuntimeOpts for the runtime.
Sourcepub fn enable_alt_timer(self, enabled: bool) -> Self
pub fn enable_alt_timer(self, enabled: bool) -> Self
Set whether Tokio’s experimental alternative timer is enabled.
This requires building with --cfg tokio_unstable and only applies to
work-stealing runtimes.
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