Expand description
A wasm32-unknown-unknown wrapper exposing [muon::parse] to JavaScript.
The muon crate itself is no_std; this thin shim links std only for the
allocator that wasm32-unknown-unknown provides, so no wasm-bindgen (or
any post-processing tool) is needed — the .wasm is loaded directly.
§ABI
Strings cross the boundary as (ptr, len) into wasm linear memory:
muon_alloc(len) -> ptr— reservelenbytes for JS to write UTF-8 into.muon_parse(ptr, len) -> out— parse those bytes; returns a pointer to a length-prefixed result: a little-endianu32byte length followed by that many bytes of UTF-8 JSON. On success it is the tagged tree dump (muon::Seq::to_json); on failure,{"error":{"offset":N,"kind":"…"}}.muon_free(ptr, len)— release a block obtained frommuon_alloc.
Functions§
- muon_
alloc - Reserve
lenbytes of linear memory and hand ownership to the caller. - muon_
free ⚠ - Release a block previously returned by
muon_alloc(samelen). - muon_
parse ⚠ - Parse
lenUTF-8 bytes atptr; return a length-prefixed JSON result.