feat: extism
This commit is contained in:
+2486
File diff suppressed because it is too large
Load Diff
@@ -6,3 +6,4 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
extism = "0.1.0"
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
> https://extism.org/docs/integrate-into-your-codebase/rust-host-sdk
|
||||
|
||||
|
||||
Binary file not shown.
@@ -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}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user