Trait InternalRuntime

Source
pub trait InternalRuntime {
    // Required methods
    fn push_boxed(&mut self, future: BoxFuture<'static, ()>) -> u64;
    fn contains(&mut self, id: u64) -> bool;
    fn sleep<'a>(&self, duration: Duration) -> BoxFuture<'a, ()>;
    fn stop(&mut self) -> Stop ;
}
Expand description

Trait to be implemented by async runtimes

Required Methods§

Source

fn push_boxed(&mut self, future: BoxFuture<'static, ()>) -> u64

Adds a new future to the queue to be completed.

Source

fn contains(&mut self, id: u64) -> bool

Returns if a future by some ID is still running.

Source

fn sleep<'a>(&self, duration: Duration) -> BoxFuture<'a, ()>

Asynchronously sleeps

Source

fn stop(&mut self) -> Stop

Stops the runtime

Implementors§