Skip to main content

Module web_socket

Module web_socket 

Source
Expand description

Browser (wasm) WebSocket adapter for the transport-neutral driver (LP-WS-TRANSPORT R3.2, folded F4/F5).

Two layers:

  • mirror — the platform-neutral conversion layer (F5): pure functions mapping browser socket facts onto the driver’s closed SocketEvent set and driver commands onto closed browser actions. No platform type appears, so it compiles natively and is pinned by the deterministic ws_browser_mirror_trace suite without a browser.
  • [adapter] — the web-sys shim (wasm32 with the browser feature): owns the JavaScript socket, pins binaryType = "arraybuffer" at construction (F4), feeds each callback once into the shared driver, and executes emitted commands. Event-driven only: no timer, interval, executor, or bufferedAmount polling.

All protocol, framing, correlation, and fate logic stays in core; both layers are mirrors, not implementors.

Re-exports§

pub use mirror::BrowserCommandRefusal;
pub use mirror::BrowserMessageData;
pub use mirror::BrowserSocketAction;
pub use mirror::action_for_command;
pub use mirror::close_event;
pub use mirror::error_event;
pub use mirror::message_event;
pub use mirror::open_event;

Modules§

mirror
Platform-neutral browser-fact mirror for the wasm adapter (R3.2, F5).