1mod client;
8mod error;
9pub mod platform;
10mod types;
11mod websocket;
12
13#[cfg(target_arch = "wasm32")]
14mod js_transport;
15#[cfg(target_arch = "wasm32")]
16mod wasm_interface;
17
18pub use client::MqttClient;
19pub use error::{Error, Result};
20pub use types::*;
21pub use websocket::{UnderlyingLayerCommand, UnderlyingLayerEvent, UnderlyingLayerInterface};
22
23#[cfg(target_arch = "wasm32")]
25pub mod wasm {
26 pub use crate::js_transport::{create_client_with_js_transport, JsTransport};
27 pub use crate::wasm_interface::{
28 WasmMqttClient, WasmMqttConfig, WasmMqttPacket, WasmPacketType,
29 };
30 pub use crate::{MqttClient, MqttConfig};
31}
32
33pub mod mqtt;
35
36#[cfg(target_arch = "wasm32")]
37use wasm_bindgen::prelude::*;
38
39#[cfg(target_arch = "wasm32")]
40#[wasm_bindgen(start)]
41pub fn init() {
42 console_error_panic_hook::set_once();
43}