Skip to main content

Crate uni_plugin_wasm_rt

Crate uni_plugin_wasm_rt 

Source
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 concrete T and 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§

InstancePool
A per-plugin instance cache with a concurrency cap.
PoolConfig
Per-pool configuration.
PoolMetrics
Pool metrics surface — read by host.metric_counter host imports.
PooledInstance
RAII handle to an instance acquired from an InstancePool.

Enums§

IpcError
Errors raised by the Arrow IPC bridge.

Functions§

decode_batch
Decode the single RecordBatch from Arrow IPC stream bytes.
decode_batches
Decode every RecordBatch from Arrow IPC stream bytes.
encode_batch
Encode a RecordBatch as Arrow IPC stream bytes.
encode_batches
Encode multiple RecordBatches sharing a schema as one IPC stream.