1#![forbid(unsafe_code)]
6
7use pharos::SharedPharos;
8use wasm_bindgen_futures::spawn_local;
9
10mod error;
11mod event;
12mod message;
13mod meta;
14mod state;
15mod stream;
16mod stream_io;
17
18pub use self::error::WsErr;
19pub use self::event::{CloseEvent, WsEvent};
20pub use self::message::WsMessage;
21pub use self::meta::WsMeta as WebSocket;
22pub use self::state::WsState;
23pub use self::stream::WsStream;
24pub use self::stream_io::WsStreamIo;
25
26pub(crate) fn notify(pharos: SharedPharos<WsEvent>, evt: WsEvent) {
28 let notify = async move {
29 pharos
30 .notify(evt)
31 .await
32 .map_err(|e| unreachable!("{:?}", e))
33 .unwrap(); };
35
36 spawn_local(notify);
37}