1 2 3 4 5 6 7 8 9 10 11 12 13
use futures::Future; use tokio::task; use crate::Spawner; /// A spawner that creates asynchronous tasks. pub enum TokioSpawner {} impl Spawner for TokioSpawner { fn spawn<F>(future: F) where F: Future + Send + 'static, F::Output: Send { task::spawn(future); } }