2020-01-20 04:47:36 +01:00
|
|
|
use crate::Executor;
|
|
|
|
|
|
|
|
|
|
use futures::Future;
|
|
|
|
|
|
2020-01-20 10:49:25 +01:00
|
|
|
/// An `async-std` runtime.
|
2020-01-20 09:49:17 +01:00
|
|
|
#[derive(Debug)]
|
2020-01-20 04:47:36 +01:00
|
|
|
pub struct AsyncStd;
|
|
|
|
|
|
|
|
|
|
impl Executor for AsyncStd {
|
|
|
|
|
fn new() -> Result<Self, futures::io::Error> {
|
|
|
|
|
Ok(Self)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn spawn(&self, future: impl Future<Output = ()> + Send + 'static) {
|
|
|
|
|
let _ = async_std::task::spawn(future);
|
|
|
|
|
}
|
|
|
|
|
}
|