summaryrefslogtreecommitdiffstats
path: root/futures/src/backend/wasm/wasm_bindgen.rs
blob: e914aeba8c3f8538af2bc238147d8a2be7be3a76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! A `wasm-bindgein-futures` backend.

/// A `wasm-bindgen-futures` executor.
#[derive(Debug)]
pub struct Executor;

impl crate::Executor for Executor {
    fn new() -> Result<Self, futures::io::Error> {
        Ok(Self)
    }

    fn spawn(&self, future: impl futures::Future<Output = ()> + 'static) {
        wasm_bindgen_futures::spawn_local(future);
    }
}