Stream: wasmtime

Topic: How to add &self in interface of Rust?


view this post on Zulip Klaus Ma (Dec 22 2023 at 08:18):

Hi team, For wit IDL, is that possible also to include &self in functions of interface for Rust lang? As I'd like to share datas between functions in the WIT.

view this post on Zulip Lann Martin (Dec 22 2023 at 13:40):

Are you referring to Wasm guest exports? There is no "self" value associated with those implementations.

view this post on Zulip Joel Dice (Dec 22 2023 at 14:29):

You can export resource types from your component, in which case each of the non-static methods will get a &self parameter in the wit-bindgen-generated Rust bindings.


Last updated: Oct 23 2024 at 20:03 UTC