Function execute

Source
pub async fn execute(source_path: &str, args: &[&str]) -> Result<String>
Expand description

Execute a complete program (not just a function) with command-line arguments.

ยงExamples

#[tokio::main]
async fn main() -> Result<(), wasm_sandbox::SandboxError> {
    // Run a CLI program
    let output = wasm_sandbox::execute("./my_program.rs", &["--input", "file.txt"]).await?;
    println!("Program output: {}", output);
    Ok(())
}