antenna-client-web 0.1.1

Web-over-WASM platform implementation for the antenna P2P mesh protocol.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod async_callback;
mod config;
mod js_event_callback;

pub use antenna_client_shared::IceServerConfig;
pub use async_callback::async_callback;
pub(crate) use config::build_rtc_config;
pub use js_event_callback::JsEventCallback;

use wasm_bindgen::JsCast;

pub fn to_js_object<T: serde::Serialize>(
    value: &T,
) -> Result<js_sys::Object, wasm_bindgen::JsValue> {
    let js = serde_wasm_bindgen::to_value(value)
        .map_err(|e| wasm_bindgen::JsValue::from_str(&e.to_string()))?;
    js.dyn_into::<js_sys::Object>()
}