Expand description
WasmLoader — top-level entry point for loading WASM Component
Model plugins.
Two-pass dance per proposal §5.6:
- Build engine with no caps; instantiate the component; call the
manifestexport to learn what caps the plugin needs. - Intersect declared ∩ host grants; rebuild the engine with
epoch-interruption + fuel metering enabled per the plugin
manifest’s resource limits; instantiate with the cap-gated
Linker; call
registerto learn the qnames; for each entry construct an adapter (currentlyComponentScalarFn; aggregate and procedure adapters land in M6b.2) and push it into thePluginRegistrar.
The actual wasmtime::Engine + Component + Linker<HostState>
plumbing lives in this file; the linker construction details are
in crate::linker.
Structs§
- Aggregate
Plugin Instance - Pooled instance for the
aggregate-pluginworld. - Component
Manifest - CM plugin manifest in canonical JSON form (the plugin’s
manifestexport’s payload). Mirrors proposal §14 and the Extism manifest shape — same fields, different ABI host. - Component
Plugin - A loaded WASM component presented as a
uni_plugin::Plugin. - Load
Outcome - Outcome of a successful
WasmLoader::load. - Prepared
Component - Outcome of
WasmLoader::prepare— everything the host needs to decide whether to instantiate the component (and what to plumb in). - Procedure
Plugin Instance - Pooled instance for the
procedure-pluginworld. - Registration
Manifest - Top-level
registerexport payload. - Scalar
Plugin Instance - Concrete instance type pooled by
WasmInstancePool. - Wasm
Loader - Top-level WASM Component Model plugin loader.
- Wire
FnSignature - Wire-level scalar signature shipped by a plugin’s
registerexport.
Enums§
- Registration
Entry - One registration entry.
- Wire
ArgType - Wire-level argument type shipped by a plugin.