Expand description
Host-time generator of wasm_registry.rs — the WASM-side replacement for
linkme. See the module for full rationale.
Host-only — the writer reads the live linkme distributed slices to format
wasm_registry.rs, and linkme isn’t available on wasm32 anyway.
Host-time generator of wasm_registry.rs — the WASM-side replacement for
linkme’s runtime distributed-slice gather.
On native builds, the cdylib runs [write_wasm_registry_to_file] to emit
Rust source listing every MX_CALL_DEFS / MX_ALTREP_REGISTRATIONS /
MX_TRAIT_DISPATCH entry as extern "C" {} declarations + ordinary
&[T] static slices. On wasm32-* targets, the user crate compiles that
file in place of the linkme distributed_slices (gating happens in step 5
of plans/webr-support.md).
The writer is intentionally pure-text-formatting — no syn, no
proc-macro2, no template engine. Output is small, append-only, and
deterministic so git diff --exit-code works as the regen check.
Structs§
- Altrep
RegRow - Pre-extracted view of one
MX_ALTREP_REGISTRATIONSentry. - Call
DefRow - Pre-extracted, cdylib-side view of one
R_CallMethodDef. - Trait
Dispatch Row - Pre-extracted view of one
MX_TRAIT_DISPATCHentry.
Constants§
Functions§
- fnv1a_
64 🔒 - FNV-1a 64-bit hash. Matches the implementation in
miniextendr-macros/src/miniextendr_impl_trait.rs::type_to_uppercase_nameso a future build.rs check can recompute it portably. - format_
altrep_ 🔒regs_ slice - format_
body 🔒 - format_
call_ 🔒defs_ slice - format_
extern_ 🔒c_ block - format_
extern_ 🔒unwind_ block - format_
trait_ 🔒dispatch_ slice - format_
wasm_ registry - Format a
wasm_registry.rssource file from extracted runtime data. - read_
runtime_ 🔒slices - Read the live linkme distributed slices and return rows safe to pass to
format_wasm_registry. - sexp_
param_ 🔒list - Comma-joined
_: SEXPparameter list for anextern { fn ...; }decl. - sexp_
type_ 🔒list - Comma-joined
SEXPtype list for anextern fn(...)type expression (e.g. insidetransmute::<...>). Function pointer types don’t carry parameter names, so_:would be invalid here. - write_
wasm_ registry_ to_ file - Read the live distributed slices, format
wasm_registry.rs, and write it topath. No-op when content is unchanged (matcheswrite_r_wrappers_to_file).