Skip to main content

Module host

Module host 

Source
Expand description

Host function registry — allows JS code to call custom Rust functions.

This module provides a registry where developers can register Rust functions (marked #[no_mangle] pub extern "C") that should be callable from translated JS/Zig code via the C ABI.

§Usage

In main.rs, create a HostFnRegistry, register Rust functions, and pass it to project.rs for metadata generation and to the transpiler pipeline for translation.

Structs§

HostFnDef
Definition of a single host function that JS can call.
HostFnRegistry
Registry of Rust host functions exposed to JS via C ABI.
HostStructDef
Definition of a struct used by host functions.
HostStructField
A field in a host struct (for C ABI ↔ Zig conversion).