Skip to main content

Crate zerodds_ts_wasm

Crate zerodds_ts_wasm 

Source
Expand description

Crate zerodds-ts-wasm. Safety classification: STANDARD (FFI boundary via wasm-bindgen; std allowed; no direct hardware/syscall access).

WASM bindings for the ZeroDDS XCDR codec. Unlike the Node variant (zerodds-ts-node), WASM cannot use UDP sockets or threads — live DDS in the browser needs a WebSocket bridge (crates/websocket-bridge).

What is exposed here:

  • XCDR1/XCDR2 encoder + decoder for primitives + strings + bytes
  • KeyHash computation (XTypes 1.3 §7.6.8)
  • endianness constants + version string

Use cases:

  • a browser frontend converts form data into XCDR, sends it via WebSocket to a DDS gateway
  • the browser receives XCDR bytes, decodes them client-side
  • schema validation + type checks without a server roundtrip

Structs§

CdrDecoder
XCDR decoder. Reads a byte slice via a position pointer.
CdrEncoder
XCDR encoder. Buffers bytes until finish() is called.

Functions§

endianness_big
endianness_little
Endianness tag for JS — 0 = little, 1 = big.
init
version