Expand description
Shared runtime helpers for the uni-db WASM plugin loaders.
uni-plugin-wasm-rt is the M6.shared lift — a crate that sits below
both uni-plugin-extism and uni-plugin-wasm in the dependency
graph and owns the two pieces of machinery they would otherwise
duplicate:
- Arrow IPC bridge (
ipc) —RecordBatch↔ stream bytes, shared between Extism’s bytes-in/bytes-out boundary and the Component Model’s linear-memory boundary. - Per-plugin instance cache (
pool) — generic over the per-invoke instance type and the loader’s error type. Both loaders alias this with their concreteTand error. It builds a fresh instance per acquire (so guest state can’t leak across calls) and enforces a concurrency cap.
Neither piece depends on extism or wasmtime; both depend only on
arrow-ipc and parking_lot. That keeps the
crate small and lets it stay below uni-plugin in the workspace
dep graph, so the trait-only embedder pays nothing for plumbing
they never invoke.
Modules§
- error
- Shared error type for the wasm-rt IPC bridge.
- ipc
- Arrow IPC bridge —
RecordBatch↔ wire-stream bytes. - pool
- Per-plugin instance cache with a concurrency cap.
Structs§
- Instance
Pool - A per-plugin instance cache with a concurrency cap.
- Pool
Config - Per-pool configuration.
- Pool
Metrics - Pool metrics surface — read by
host.metric_counterhost imports. - Pooled
Instance - RAII handle to an instance acquired from an
InstancePool.
Enums§
- IpcError
- Errors raised by the Arrow IPC bridge.
Functions§
- decode_
batch - Decode the single
RecordBatchfrom Arrow IPC stream bytes. - decode_
batches - Decode every
RecordBatchfrom Arrow IPC stream bytes. - encode_
batch - Encode a
RecordBatchas Arrow IPC stream bytes. - encode_
batches - Encode multiple
RecordBatches sharing a schema as one IPC stream.