Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh Rust language guide #196

Open
kate-goldenring opened this issue Feb 26, 2025 · 1 comment
Open

Refresh Rust language guide #196

kate-goldenring opened this issue Feb 26, 2025 · 1 comment

Comments

@kate-goldenring
Copy link
Collaborator

We are coming up on conference season. Lets make sure we've walked through the Rust language guide before end of March

@FrankReh
Copy link

If someone would like the Rust guide to use the latest wasmtime release, v31, the porting suggesting from this PR is relevant (bytecodealliance/wasmtime#10016).

These changes were needed to move from v29 to v30, but the latest published release is v31.

diff --git a/component-model/examples/example-host/Cargo.toml b/component-model/examples/example-host/Cargo.toml
index b364a90..3aed8b7 100644
--- a/component-model/examples/example-host/Cargo.toml
+++ b/component-model/examples/example-host/Cargo.toml
@@ -10,5 +10,5 @@ Example Rust-based WebAssembly host that executes WebAssembly components
 anyhow = "1.0.72"
 async-std = { version = "1.13", features = ["attributes"] }
 clap = { version = "4", features = ["derive"] }
-wasmtime = "27.0"
-wasmtime-wasi = "27.0"
+wasmtime = "31.0"
+wasmtime-wasi = "31.0"
diff --git a/component-model/examples/example-host/src/state.rs b/component-model/examples/example-host/src/state.rs
index 74819bc..b13b4ba 100644
--- a/component-model/examples/example-host/src/state.rs
+++ b/component-model/examples/example-host/src/state.rs
@@ -1,5 +1,5 @@
 use wasmtime::component::ResourceTable;
-use wasmtime_wasi::{WasiCtx, WasiCtxBuilder, WasiView};
+use wasmtime_wasi::{IoView, WasiCtx, WasiCtxBuilder, WasiView};
 
 pub struct States {
     table: ResourceTable,
@@ -14,11 +14,13 @@ impl States {
     }
 }
 
-impl WasiView for States {
+impl IoView for States {
     fn table(&mut self) -> &mut ResourceTable {
         &mut self.table
     }
+}
 
+impl WasiView for States {
     fn ctx(&mut self) -> &mut WasiCtx {
         &mut self.ctx
     }

@kate-goldenring kate-goldenring removed their assignment Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: By March 27, 2025
Development

No branches or pull requests

2 participants