1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[cfg(feature = "async-std")]
mod async_std;
#[cfg(feature = "tokio")]
mod tokio;

use futures::Future;

#[cfg(feature = "async-std")]
pub use self::async_std::*;
#[cfg(feature = "tokio")]
pub use self::tokio::*;

/// A facility to spawn asynchronous tasks.
pub trait Spawner {
    fn spawn<F>(future: F) where F: Future + Send + 'static, F::Output: Send;
}