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.
  • Pre-warmed instance pool (pool) — generic over the pooled instance type and the loader’s error type. Both loaders alias this with their concrete T and error.

Neither piece depends on extism or wasmtime; both depend only on arrow-ipc, crossbeam-queue, 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
Generic pre-warmed instance pool for wasm-backed plugins.

Structs§

InstancePool
A pool of pre-warmed instances for one plugin.
PoolConfig
Per-pool configuration.
PoolMetrics
Pool metrics surface — read by host.metric_counter host imports.
PooledInstance
RAII wrapper acquired from an InstancePool: holds the instance and returns it to the pool on drop.

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.