Use own plugin

This commit is contained in:
Fabian Schmidt 2024-01-12 15:54:16 +01:00
parent 3c801ed649
commit c611966165

View File

@ -1,14 +1,14 @@
use extism::*; use extism::*;
fn main() { fn main() {
let url = // let url =
Wasm::url("https://github.com/extism/plugins/releases/latest/download/count_vowels.wasm"); // Wasm::url("https://github.com/extism/plugins/releases/latest/download/count_vowels.wasm");
let url = Wasm::file("../plugin/target/wasm32-unknown-unknown/debug/plugin.wasm");
let manifest = Manifest::new([url]); let manifest = Manifest::new([url]);
let mut plugin = Plugin::new(&manifest, [], true).unwrap(); let mut plugin = Plugin::new(manifest, [], true).unwrap();
let res = plugin let res = plugin
.call::<&str, &str>("count_vowels", "Hello, world!") .call::<&str, &str>("count_vowels", "Hello, world!")
.unwrap(); .unwrap();
println!("{}", res); println!("{}", res);
} }