Expand description
Extism loader for the uni-db plugin framework.
uni-plugin-extism is the user-facing WASM loader. It sits
parallel to uni-plugin-wasm (the Component Model loader). It follows
the “Option C” hybrid pattern:
- Component Model (
uni-plugin-wasm) — typed WIT contracts, capability gating by linker absence, used for the Lua-host, trusted built-ins, and plugins where soundness is load-bearing. - Extism (this crate) — bytes-in / bytes-out, runtime-checked capabilities, used for user-authored UDFs that benefit from Extism’s mature 13-language host SDK story.
Trust is a property of the granted CapabilitySet, not of which
ABI a plugin happens to use. A user can author a “trusted” plugin in
Extism by granting it broad capabilities; a built-in can author
against Extism if the structural advantages of CM aren’t load-bearing
for its use case. The framework intentionally decouples ABI choice
from trust tier.
§Crate status
Loader is wired through the extism-sdk. ExtismLoader::load runs a
two-pass instantiation (manifest probe, then plugin build) and
surfaces failures as ExtismError::Instantiate. The host-fn
registration surface (HostFnRegistry) and capability gating model
are in place; the NotYetImplemented placeholder has been retired.
§Why two WASM loaders
The proposal’s loader matrix (§5.1) keeps the four authoring
categories (compile-time Rust, WASM, PyO3, Lua) but splits the WASM
row into two ABIs. Both ABIs converge on the same PluginRegistrar
— the executor cannot tell whether a registered ScalarPluginFn was
authored against WIT or Extism. The two loaders share the wasmtime
runtime (Extism is itself wasmtime-backed), so the runtime cost is
one wasmtime process, not two.
Modules§
- adapter
- Adapters bridging Extism plugin exports to the
uni_plugincapability traits. - adapter_
aggregate - Aggregate adapter — bridges Extism aggregate plugins to
AggregatePluginFn/PluginAccumulator. - adapter_
common - Shared helpers for the three Extism adapter modules.
- adapter_
procedure - Procedure adapter — bridges Extism procedure plugins to
ProcedurePlugin. - error
- Error types for the Extism loader.
- exports
- Plugin-export readers —
manifestandregister. - host_
fns - Host function registration surface for Extism plugins.
- host_
svc - Capability-gated host services for Extism plugins.
- ipc
- Arrow IPC bridge — re-exported from
uni-plugin-wasm-rt. - loader
ExtismLoader— top-level entry point for loading Extism plugins.- pool
- Instance pool — re-exported from
uni-plugin-wasm-rt. - wire_
translate - Wire → internal type translation.
Structs§
- Extism
Aggregate Fn AggregatePluginFnadapter wrapping an Extism plugin pool.- Extism
Loader - Top-level Extism plugin loader.
- Extism
Procedure ProcedurePluginadapter wrapping an Extism plugin pool.- Extism
Scalar Fn ScalarPluginFnadapter wrapping an Extism plugin pool.- Host
FnRegistry - Registry of host functions available to Extism plugins.
- Registration
Manifest - Top-level
registerexport payload. - Wire
FnSignature - Wire-level scalar / aggregate / procedure signature shipped by a
plugin’s
registerexport.
Enums§
- Extism
Error - Errors specific to the Extism loader.
- Registration
Entry - One registration entry — a single qname plus its kind + signature.
- Wire
ArgType - Wire-level argument type shipped by a plugin.
Functions§
- arrow_
name_ to_ datatype - Map an Arrow primitive name (lowercase, as plugins write it) to
arrow_schema::DataType. - parse_
manifest_ json - Parse the bytes returned by a plugin’s
manifestexport into anExtismPluginManifest. - parse_
registration_ json - Parse the bytes returned by a plugin’s
registerexport into aRegistrationManifest. - read_
manifest_ export - Call a live plugin’s
manifestexport and parse the response. - read_
register_ export - Call a live plugin’s
registerexport and parse the response. - register_
default_ host_ svc - Register the default capability-gated host-service surface on a loader.
- wire_
arg_ to_ internal - Translate a wire
WireArgTypeinto the internalArgType. - wire_
fn_ sig_ to_ internal - Translate a full wire scalar/window signature into the internal
FnSignature. - wire_
null_ handling_ to_ internal - Translate a wire null-handling string into the internal enum.
- wire_
volatility_ to_ internal - Translate a wire volatility string into the DataFusion enum.