Skip to main content

Module loader

Module loader 

Source
Expand description

WasmLoader — top-level entry point for loading WASM Component Model plugins.

Two-pass dance per proposal §5.6:

  1. Build engine with no caps; instantiate the component; call the manifest export to learn what caps the plugin needs.
  2. 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 register to learn the qnames; for each entry construct an adapter (currently ComponentScalarFn; aggregate and procedure adapters land in M6b.2) and push it into the PluginRegistrar.

The actual wasmtime::Engine + Component + Linker<HostState> plumbing lives in this file; the linker construction details are in crate::linker.

Structs§

AggregatePluginInstance
Pooled instance for the aggregate-plugin world.
ComponentManifest
CM plugin manifest in canonical JSON form (the plugin’s manifest export’s payload). Mirrors proposal §14 and the Extism manifest shape — same fields, different ABI host.
ComponentPlugin
A loaded WASM component presented as a uni_plugin::Plugin.
LoadOutcome
Outcome of a successful WasmLoader::load.
PreparedComponent
Outcome of WasmLoader::prepare — everything the host needs to decide whether to instantiate the component (and what to plumb in).
ProcedurePluginInstance
Pooled instance for the procedure-plugin world.
RegistrationManifest
Top-level register export payload.
ScalarPluginInstance
Concrete instance type pooled by WasmInstancePool.
WasmLoader
Top-level WASM Component Model plugin loader.
WireFnSignature
Wire-level scalar signature shipped by a plugin’s register export.

Enums§

RegistrationEntry
One registration entry.
WireArgType
Wire-level argument type shipped by a plugin.