2
examples/agent-ping/.cargo/config.toml
Normal file
2
examples/agent-ping/.cargo/config.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[build]
|
||||
target = "wasm32-wasi"
|
15
examples/agent-ping/Cargo.toml
Normal file
15
examples/agent-ping/Cargo.toml
Normal file
@@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "agent-ping"
|
||||
repository.workspace = true
|
||||
description.workspace = true
|
||||
readme.workspace = true
|
||||
license-file.workspace = true
|
||||
authors.workspace = true
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
wit-bindgen = { git = "https://github.com/bytecodealliance/wit-bindgen", tag = "wit-bindgen-0.10.0" }
|
15
examples/agent-ping/src/lib.rs
Normal file
15
examples/agent-ping/src/lib.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
wit_bindgen::generate!({
|
||||
world: "host",
|
||||
|
||||
exports: {
|
||||
world: MyHost,
|
||||
},
|
||||
});
|
||||
|
||||
struct MyHost;
|
||||
|
||||
impl Host for MyHost {
|
||||
fn run() {
|
||||
print("Hello, world!");
|
||||
}
|
||||
}
|
7
examples/agent-ping/wit/host.wit
Normal file
7
examples/agent-ping/wit/host.wit
Normal file
@@ -0,0 +1,7 @@
|
||||
package example:host
|
||||
|
||||
world host {
|
||||
import print: func(msg: string)
|
||||
|
||||
export run: func()
|
||||
}
|
Reference in New Issue
Block a user