Hi! What's the best way to share types between guest and host that have additional impls? Like for example I want to share enum and implement Display on the enum, I can do that on the guest side by generating bindings with wit-bindgen and adding impls on that, but I can't add the bindings to with:
for wasmtine bindgen!
macro since it doesn't generate host bindings, which makes sense but it's just enums. The best way I can think of is proc macros to generate new impls for generated types in both host and guest but it doesn't seem very nice.
you might be able to hack this up with a shared file that's include!
'd on one half and used as a normal module on the other, but beyond that I'm not coming up with anything myself
ah yes that would work as well, I guess might be more readable than proc macros, thanks!
Last updated: Feb 28 2025 at 03:10 UTC