arpy_reqwasm/
lib.rs

1//! Reqwasm client for Arpy.
2//!
3//! This provides an [`http`] and a [`websocket`] client, suitable for use from
4//! a browser.
5use arpy_client::Spawner;
6use thiserror::Error;
7
8pub mod eventsource;
9pub mod http;
10pub mod websocket;
11
12pub use arpy_client::Error;
13use wasm_bindgen_futures::spawn_local;
14
15#[derive(Clone)]
16struct LocalSpawner;
17
18impl Spawner for LocalSpawner {
19    fn spawn_local<F>(&self, future: F)
20    where
21        F: futures::Future<Output = ()> + 'static,
22    {
23        spawn_local(future)
24    }
25}