Stream: wasmtime

Topic: ✔ Understanding wasmtime better - Store


view this post on Zulip Christoph Brewing (Oct 05 2023 at 09:00):

I currently try to upgrade my real-world host from wasmtime 10 to wasmtime 13 and noticed that quite a few things have changed. To better understand I observe a current wasmtime example where a component is created and the component is loaded from a Rust application.

One difference between given example and my current application is the data parameter of Store.

// my real-world app based on wasmtime 10
let mut store = Store::new(&engine, data: 0);

// wasmtime example based on wasmtime 13
let wasi_view = ServerWasiView::new()?;
let mut store = Store::new(&engine, wasi_view);

where ServerWasiView is a struct with the two fields table and ctx.

My question is: do I need ServerWasiView at all in order to launch a component from a Rust application?
What is it good for?

view this post on Zulip Alex Crichton (Oct 05 2023 at 14:17):

If you plan on using WASI then the WasiView trait is required to be implemented for the T in Store<T>, but if you don't plan on using WASI there's no need to use that

view this post on Zulip Alex Crichton (Oct 05 2023 at 16:55):

(wrong chat maybe here trevor)

view this post on Zulip Trevor Elliott (Oct 05 2023 at 16:57):

absolutely was, sorry about that!

view this post on Zulip Christoph Brewing (Oct 05 2023 at 18:45):

Thank you for the clarification. I just need a "plain" component, at least currently. In my existing application, I compile to wasm32-unknown-unknown and transform it to a component with wasm-tools thereafter. So I guess, I will try it again without wasi: data: 0.

view this post on Zulip Notification Bot (Oct 05 2023 at 18:45):

Christoph Brewing has marked this topic as resolved.


Last updated: Nov 22 2024 at 17:03 UTC