ya-runtime-wasi
This crate allows you to embed Yagna WASI runtime inside your application.
Quick start
The usage is pretty straightforward. In your Cargo.toml
, put ya-runtime-wasi
as your dependency
# Cargo.toml
[]
= "0.2"
You can now embed the runtime in your app like so
use Path;
use *;
// In this example, we assume that `package.zip` contains a WASI binary
// called `hello.wasm`, and maps input/output to `/workdir`
let workspace = new;
let module_name = "hello.wasm";
let package = new;
// Deploy package
deploy.unwrap;
// Start the runtime
start.unwrap;
// Execute the binary
run.unwrap;
Examples
A good example of using ya-runtime-wasi
embedding API can be found in the gfaas
crate.