pub trait RuntimeDriver: Clone + 'static {
// Required methods
fn now(&self) -> Duration;
fn sleep_until(&self, deadline: Duration) -> LocalBoxFuture<'static, ()>;
fn yield_now(&self) -> LocalBoxFuture<'static, ()>;
fn spawn_local(&self, task: LocalTask) -> Result<DriverTask, SpawnError>;
fn shutdown_requested(&self) -> bool;
// Provided method
fn jitter(&self, _maximum: Duration) -> Duration { ... }
}Expand description
Host facilities required to advance the portable Kernel.
Required Methods§
Sourcefn sleep_until(&self, deadline: Duration) -> LocalBoxFuture<'static, ()>
fn sleep_until(&self, deadline: Duration) -> LocalBoxFuture<'static, ()>
Waits until the supplied monotonic instant.
Sourcefn yield_now(&self) -> LocalBoxFuture<'static, ()>
fn yield_now(&self) -> LocalBoxFuture<'static, ()>
Cooperatively yields to other work on the local task lane.
Sourcefn spawn_local(&self, task: LocalTask) -> Result<DriverTask, SpawnError>
fn spawn_local(&self, task: LocalTask) -> Result<DriverTask, SpawnError>
Schedules Kernel-owned work on the local task lane.
Sourcefn shutdown_requested(&self) -> bool
fn shutdown_requested(&self) -> bool
Reports whether the embedding Runner requested shutdown.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".