Skip to content

Commit

Permalink
Update more examples to wit-bindgen 0.12
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Levick <[email protected]>
  • Loading branch information
rylev committed Oct 5, 2023
1 parent 77bff00 commit a540c71
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 64 deletions.
4 changes: 2 additions & 2 deletions crates/core/tests/core-wasi-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "core-wasi-test"
name = "core-wasi-test"
version = "0.1.0"
edition = "2021"

[profile.release]
debug = true

[dependencies]
wit-bindgen = "0.8"
wit-bindgen = "0.12"

[workspace]
149 changes: 92 additions & 57 deletions examples/spin-timer/app-example/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/spin-timer/app-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
wit-bindgen = "0.8.0"
wit-bindgen = "0.12"

[workspace]
9 changes: 5 additions & 4 deletions examples/spin-timer/app-example/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
wit_bindgen::generate!({
world: "spin-timer",
path: ".."
path: "..",
exports: {
world: MySpinTimer
}
});

use fermyon::spin::config;

struct MySpinTimer;

impl SpinTimer for MySpinTimer {
impl Guest for MySpinTimer {
fn handle_timer_request() {
let text = config::get_config("message").unwrap();
println!("{text}");
}
}

export_spin_timer!(MySpinTimer);

0 comments on commit a540c71

Please sign in to comment.