feat: extism
This commit is contained in:
2486
__wasm/extism/extism_container/Cargo.lock
generated
Normal file
2486
__wasm/extism/extism_container/Cargo.lock
generated
Normal file
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"
|
||||
|
||||
3
__wasm/extism/extism_container/README.md
Normal file
3
__wasm/extism/extism_container/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
> https://extism.org/docs/integrate-into-your-codebase/rust-host-sdk
|
||||
|
||||
|
||||
BIN
__wasm/extism/extism_container/code.wasm
Normal file
BIN
__wasm/extism/extism_container/code.wasm
Normal file
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