pub struct HostFnSpec {
pub nomi_name: String,
pub import_module: String,
pub import_name: String,
pub params: Vec<WasmType>,
pub result: Option<WasmType>,
}Expand description
Description of a single host fn the caller wants nomiscript code to be able to invoke.
result: Option<WasmType> is the single source of truth for the wasm
import signature. The compiler reads it via
CompileContext::host_import_return_type and declares the import
using the abstract heap type ((ref null struct) / (ref null array))
that matches wasmtime’s Rooted<StructRef> / Rooted<ArrayRef>
WasmTy::valtype(); a ref.cast after every call recovers the
concrete type. No per-shape flags, no synthesized guest-side wrap
helpers — host returns the GC ref directly.
Fields§
§nomi_name: StringSymbol the lisp source uses, e.g. rpc-protocol-version. Stored
uppercase to match the reader’s symbol-normalisation behaviour.
import_module: StringWasm import module — typically "nomi" for the rpc-eval channel.
import_name: StringWasm import function name — typically the snake_case rpc fn name.
params: Vec<WasmType>Parameter wasm types (in declaration order).
result: Option<WasmType>Return type, None for () -> () host fns.
Implementations§
Trait Implementations§
Source§impl Clone for HostFnSpec
impl Clone for HostFnSpec
Source§fn clone(&self) -> HostFnSpec
fn clone(&self) -> HostFnSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more