Skip to main content

smg_wasm/
lib.rs

1//! WebAssembly (WASM) module support for Shepherd Model Gateway
2//!
3//! This crate provides WASM component execution capabilities using the WebAssembly Component Model.
4//! It supports middleware execution at various attach points (OnRequest, OnResponse) with async support.
5
6pub mod config;
7pub mod errors;
8pub mod module;
9pub mod module_manager;
10pub mod runtime;
11pub mod spec;
12#[cfg(feature = "storage-hooks")]
13pub mod storage_hook;
14#[cfg(feature = "storage-hooks")]
15mod storage_spec;
16pub mod types;
17
18// Re-export commonly used types
19pub use config::WasmRuntimeConfig;
20pub use errors::{Result, WasmError, WasmManagerError, WasmModuleError, WasmRuntimeError};
21pub use module::{
22    MiddlewareAttachPoint, WasmMetrics, WasmModule, WasmModuleAddRequest, WasmModuleAddResponse,
23    WasmModuleAddResult, WasmModuleAttachPoint, WasmModuleDescriptor, WasmModuleListResponse,
24    WasmModuleMeta, WasmModuleType,
25};
26pub use module_manager::WasmModuleManager;
27pub use runtime::WasmRuntime;
28pub use spec::{apply_modify_action_to_headers, build_wasm_headers_from_axum_headers, smg, Smg};
29#[cfg(feature = "storage-hooks")]
30pub use storage_hook::WasmStorageHook;
31pub use types::{WasiState, WasmComponentInput, WasmComponentOutput};