Trait async_core::Runtime

source ·
pub trait Runtime<'a> {
    fn push_boxed(&'a mut self, future: BoxFuture<'static, ()>);
    fn spawn_boxed(
        &'a mut self,
        future: BoxFuture<'static, ()>
    ) -> SpawnedFuture<'a> ; fn sleep<'b>(&'a self, duration: Duration) -> BoxFuture<'b, ()>; fn stop(&mut self); fn push(&'a mut self, future: impl Future<Output = ()> + 'static) { ... } fn spawn(
        &'a mut self,
        future: impl Future<Output = ()> + 'static
    ) -> SpawnedFuture<'a> { ... } fn sleep_ms<'b>(&'a self, amount: u64) -> BoxFuture<'b, ()> { ... } }
Expand description

Auto-trait with the methods that will actually be called by the users of the runtime.

Required Methods§

Adds a new future to the queue to be completed.

Adds a new future to the queue to be completed and returns a future waiting for the added future’s completion.

Asynchronously sleeps

Stops the runtime. This does not exit the process.

Provided Methods§

Adds a new future to the queue to be completed.

Adds a new future to the queue to be completed and returns a future waiting for the added future’s completion.

Asynchronously sleeps some amount of milliseconds

Implementors§