pub struct RuntimeBuilder { /* private fields */ }Expand description
Builder for Runtime.
Implementations§
Source§impl RuntimeBuilder
impl RuntimeBuilder
Sourcepub fn new() -> RuntimeBuilder
pub fn new() -> RuntimeBuilder
Creates a builder with the default scheduler budgets and warning thresholds.
Sourcepub fn event_interval(&mut self, val: usize) -> &mut RuntimeBuilder
pub fn event_interval(&mut self, val: usize) -> &mut RuntimeBuilder
Sets the local task-poll budget for one Runtime::poll call.
The driver can process external events between calls. Remote work is serviced in separate batches, so this is not a strict limit on all work done in one call. The default is 61; zero is treated as one.
Sourcepub fn self_wake_threshold(
&mut self,
count: u32,
duration: Duration,
) -> &mut RuntimeBuilder
pub fn self_wake_threshold( &mut self, count: u32, duration: Duration, ) -> &mut RuntimeBuilder
Sets the self-wake streak that is reported as a possible busy loop.
A task that wakes itself on every poll, for example a loop around
wake_by_ref() or a yield, never waits for an event. The runtime logs
a warning with the task spawn location once the task wakes itself
count times in a row and the streak lasts at least duration. Each
streak is reported once. A count of 0 disables the warning and per-task
streak tracking, but preserves Runtime::self_wake_count.
By default, 10 000 self-wakes over at least 1 second.
Sourcepub fn timer_resolution(&mut self, millis: u8) -> &mut RuntimeBuilder
pub fn timer_resolution(&mut self, millis: u8) -> &mut RuntimeBuilder
Sets the resolution of the runtime timer wheel, in milliseconds.
The resolution must be a power of two between 1 and 16. By default,
the wheel uses Builder::timer_resolution
of the system that is current when the first timer is armed.
§Panics
Panics if millis is not a power of two between 1 and 16.
Trait Implementations§
Source§impl Clone for RuntimeBuilder
impl Clone for RuntimeBuilder
Source§fn clone(&self) -> RuntimeBuilder
fn clone(&self) -> RuntimeBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RuntimeBuilder
impl Debug for RuntimeBuilder
Source§impl Default for RuntimeBuilder
impl Default for RuntimeBuilder
Source§fn default() -> RuntimeBuilder
fn default() -> RuntimeBuilder
Uses the default scheduler budgets and self-wake thresholds.