wasmer
wasmer copied to clipboard
Pass a native(rust) struct to Webassembly function/native function
trafficstars
Summary
From the examples i can pass value type(numerics), but how do I pass structs value or pointers
https://github.com/wasmerio/wit-bindgen can help with that. Or you can roll it yourself, e.g. serialize the native struct, write the data to wasm memory, pass a pointer to the data to a wrapper function inside wasm, deserialize the data there, call the original function (This is more tricky than it sounds).