run

Function run 

Source
pub fn run(
    workdir: impl AsRef<Path>,
    entrypoint: impl AsRef<str>,
    args: impl IntoIterator<Item = String>,
) -> Result<()>
Expand description

Instantiates and executes the deployed image using Wasmtime runtime.

Takes path to the workdir, an entrypoint (name of WASI binary), and input arguments as arguments.

ยงExample

use std::path::Path;
use ya_runtime_wasi::run;

run(
    Path::new("workspace"),
    "hello",
    vec![
        "/workdir/input".into(),
        "/workdir/output".into(),
    ],
).unwrap();