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

19 lines
393 B
Rust
Raw Normal View History

use crate::Executor;
/// A type representing a `wasm-bindgen-futures` runtime.
#[derive(Debug)]
pub struct WasmBindgen;
impl Executor for WasmBindgen {
fn new() -> Result<Self, futures::io::Error> {
Ok(Self)
}
fn spawn(
&self,
future: impl futures::Future<Output = ()> + Send + 'static,
) {
wasm_bindgen_futures::spawn_local(future);
}
}