'Hello World' plugin example
This commit is contained in:
commit
3c801ed649
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/target
|
2704
Cargo.lock
generated
Normal file
2704
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
9
Cargo.toml
Normal file
9
Cargo.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "app"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
extism = "1.0.0"
|
14
src/main.rs
Normal file
14
src/main.rs
Normal file
@ -0,0 +1,14 @@
|
||||
use extism::*;
|
||||
|
||||
fn main() {
|
||||
let url =
|
||||
Wasm::url("https://github.com/extism/plugins/releases/latest/download/count_vowels.wasm");
|
||||
let manifest = Manifest::new([url]);
|
||||
let mut plugin = Plugin::new(&manifest, [], true).unwrap();
|
||||
|
||||
let res = plugin
|
||||
.call::<&str, &str>("count_vowels", "Hello, world!")
|
||||
.unwrap();
|
||||
println!("{}", res);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user