Expand description
WASM Plugin Runtime
Real wasmtime-backed plugin executor.
§ABI
Plugins export, at minimum:
memory(default linear memory).alloc(size: i32) -> i32— host calls this to obtain a slot in plugin memory it can write input bytes into.dealloc(ptr: i32, size: i32)— host calls this to free either the input slot (after the call) or the output slot (after the host has read the result).- One function per declared hook, with one of two signatures:
- Result-returning hooks (
pre_query,route,authenticate,rewrite):(ptr: i32, len: i32) -> i64where the i64 is(result_ptr << 32) | result_len.result_ptr == 0 && result_len == 0is a valid “no result” reply (host treats it as the default per-hook outcome). - Observer hooks (
post_query,metrics,on_connect,on_disconnect):(ptr: i32, len: i32)with no return — the host ignores any output the plugin may have written.
- Result-returning hooks (
The runtime tries the result-returning signature first; if the exported function has the no-return shape it falls back.
Structs§
- Loaded
Plugin - A loaded and instantiated plugin
- Runtime
Stats - Runtime statistics
- Wasm
Plugin Runtime - WASM plugin runtime
Enums§
- Plugin
Error - Error types for plugin operations
- Plugin
State - Plugin state