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

18 lines
365 B
Rust
Raw Normal View History

use crate::Executor;
use futures::Future;
2020-01-20 09:49:17 +01:00
/// A type representing the `async-std` runtime.
#[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);
}
}