wasi-preview1-component-adapter-provider
A Bytecode Alliance project
A utility library containing binaries for WASI Preview1 adapters for easy use from Rust.
`wasi-preview1-component-adapter-provider` contains the raw bytes of the WASI Preview1 to Preview2 adapters (Reactor, Command, and Proxy).
For example, if you wanted to write the adapter bytes back into a `.wasm` binary:
```rust
use wasi_preview1_component_adapter_provider::WASI_SNAPSHOT_PREVIEW1_REACTOR_ADAPTER;
fn main() {
std::fs::write(
"wasi_snapshot_preview1.reactor.wasm",
WASI_SNAPSHOT_PREVIEW1_REACTOR_ADAPTER
).expect("failed to write bytes to file");
}
```
A more realistic use-case is performing the *adaptation* step of preparing a WASI Preview2 component from an existing WASI Preview1 component:
```rust
use wasi_preview1_component_adapter_provider::WASI_SNAPSHOT_PREVIEW1_REACTOR_ADAPTER;
use wit_component::ComponentEncoder;
fn main() -> Result<(), Box