iced-yoda/futures/src/executor/async_std.rs

19 lines
397 B
Rust
Raw Normal View History

use crate::Executor;
use futures::Future;
/// An `async-std` runtime.
2020-04-04 02:25:40 +01:00
#[cfg_attr(docsrs, doc(cfg(feature = "async-std")))]
2020-01-20 09:49:17 +01:00
#[derive(Debug)]
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);
}
}