feat: extism

This commit is contained in:
2022-12-04 14:40:25 +08:00
parent 78db54db6c
commit 78561aec5b
5 changed files with 2497 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
use extism::{Context, Plugin};
fn main() {
println!("Hello, world!");
let wasm = include_bytes!("../code.wasm");
let context = Context::new();
let mut plugin = Plugin::new(&context, wasm, false).unwrap();
let data = plugin.call("count_vowels", "this is a test").unwrap();
assert_eq!(data, b"{\"count\": 4}");
}