Trait janus_core::Runtime

source ·
pub trait Runtime {
    // Required method
    fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
       where F: Future + Send + 'static,
             F::Output: Send + 'static;
}
Expand description

This trait provides a mockable facade for tokio::task::spawn.

Required Methods§

source

fn spawn<F>(&self, future: F) -> JoinHandle<F::Output>
where F: Future + Send + 'static, F::Output: Send + 'static,

Spawn a future on a new task managed by an asynchronous runtime, and return a handle that can be used to await completion of that task.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Runtime for TokioRuntime

source§

impl Runtime for TestRuntime

Available on crate feature test-util only.