Expand description
WASM Component Model loader for the uni-db plugin framework.
uni-plugin-wasm provides the host-side machinery to load WASM
plugins built against the uni:plugin WIT worlds. The boundary uses:
- WIT-typed contracts for each plugin kind (scalar, aggregate, procedure, locy-agg, hook, storage, …) — typed exports + capability- gated host imports.
- Arrow IPC over linear memory for
RecordBatchexchange — host calls plugin’salloc(len), copies IPC bytes in, calls the work export, reads IPC bytes back at the returned(ptr, len). - Pre-warmed instance pools to amortize the 10–100 ms wasmtime instantiation cost across hot-path UDF invocations.
§Crate status
WasmLoader::load is fully wired behind the wasmtime-runtime
feature (default-on): it instantiates a component, negotiates
capabilities against the host grants, and registers the plugin’s
scalar / aggregate / procedure adapters end-to-end through the
respective WIT worlds.
Modules§
- adapter
ComponentScalarFn— bridges a CMscalar-plugininstance toScalarPluginFn.- adapter_
aggregate - Aggregate adapter — bridges a CM
aggregate-plugininstance toAggregatePluginFn/PluginAccumulator. - adapter_
procedure - Procedure adapter — bridges a CM
procedure-plugininstance toProcedurePlugin. - bindings
- wasmtime-generated bindings for the
uni:pluginWIT worlds. - buffer
WasmIpcBuffer— RAII handle for a buffer allocated inside a WASM plugin’s linear memory.- error
- Error types for the WASM loader.
- host_
state - Per-
Storehost state. - ipc
- Arrow IPC bridge — re-exported from
uni-plugin-wasm-rt. - linker
- Per-major
Linkerbuilder for the scalar-plugin world. - loader
WasmLoader— top-level entry point for loading WASM Component Model plugins.- multi_
version - M10 per-major
Linkercache for multi-version ABI coexistence. - pool
- Instance pool — re-exported from
uni-plugin-wasm-rt.
Structs§
- Multi
Version Linker - Per-major
Linkercache. - Wasm
IpcBuffer - RAII handle to a buffer allocated inside a WASM plugin’s linear memory.
- Wasm
Loader - Top-level WASM Component Model plugin loader.
Enums§
- Wasm
Error - Errors specific to the WASM loader.
Constants§
- SUPPORTED_
MAJORS - Major versions the host can link against.
Type Aliases§
- Wasm
Instance Pool - Type alias — generic
InstancePoolparameterized withcrate::WasmError.