Skip to main content

uni_plugin_wasm_rt/
lib.rs

1//! Shared runtime helpers for the uni-db WASM plugin loaders.
2//!
3//! `uni-plugin-wasm-rt` is the M6.shared lift — a crate that sits below
4//! both `uni-plugin-extism` and `uni-plugin-wasm` in the dependency
5//! graph and owns the two pieces of machinery they would otherwise
6//! duplicate:
7//!
8//! - **Arrow IPC bridge** ([`ipc`]) — `RecordBatch` ↔ stream bytes,
9//!   shared between Extism's bytes-in/bytes-out boundary and the
10//!   Component Model's linear-memory boundary.
11//! - **Pre-warmed instance pool** ([`pool`]) — generic over the pooled
12//!   instance type and the loader's error type. Both loaders alias
13//!   this with their concrete `T` and error.
14//!
15//! Neither piece depends on extism or wasmtime; both depend only on
16//! `arrow-ipc`, `crossbeam-queue`, and `parking_lot`. That keeps the
17//! crate small and lets it stay below `uni-plugin` in the workspace
18//! dep graph, so the trait-only embedder pays nothing for plumbing
19//! they never invoke.
20
21// Rust guideline compliant
22#![warn(missing_docs)]
23#![warn(rust_2018_idioms)]
24#![warn(missing_debug_implementations)]
25
26pub mod error;
27pub mod ipc;
28pub mod pool;
29
30#[doc(inline)]
31pub use error::IpcError;
32#[doc(inline)]
33pub use ipc::{decode_batch, decode_batches, encode_batch, encode_batches};
34#[doc(inline)]
35pub use pool::{InstancePool, PoolConfig, PoolMetrics, PooledInstance};