wash-runtime
wash-runtime is an opinionated Wasmtime wrapper that provides a runtime and workload API for executing WebAssembly components. It offers a simplified interface for embedding Wasm component execution in Rust applications with built-in support for WASI interfaces.
Features
- Component Model Runtime: Native support for WebAssembly Component Model using Wasmtime
- WASI Interface Support: Built-in plugins for WASI HTTP, Config, Logging, Blobstore, and Key-Value
- Workload API: High-level API for managing and executing component workloads
- Plugin System: Extensible architecture for custom capability providers
- OCI Integration: Optional support for pulling components from OCI registries
- Hot-Reload Ready: Designed for development workflows with fast iteration
Usage
Basic Example
use Arc;
use HashMap;
use ;
async
Cargo Features
The crate supports the following cargo features:
wasi-http(default): HTTP client and server support viawasmtime-wasi-httpwasi-config(default): Runtime configuration interfacewasi-logging(default): Logging interfacewasi-blobstore(default): Blob storage interfacewasi-keyvalue(default): Key-value storage interfaceoci: OCI registry integration for pulling components
Architecture
wash-runtime provides three main abstractions:
- Engine: Wasmtime configuration and component compilation
- Host: Runtime environment with plugin management
- Workload: High-level API for managing component lifecycles
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.