Export Rust shims and bindings #3499
-
SummaryA clear and concise summary of your question.
Is there a method to get the same functionality but generate the bindings for rust functions? Additional DetailsThe use case I am having is a wasm module which downloads another wasm file over the network. The binary and url is not known, but the API of them are the same. The wasm file then needs to call functions of the downloaded wasm using complex types such as strings. Additionally, the downloaded client wasm makes use of wasm-bindgen internally and links to I am aware that calling an "FFI style" function from the parent wasm is possible, but it is not feasable to uphold the invariants that the wasm_bindgen call marshalling expects, as well as the format not being stable or necessarily public. Including the wasm file as a rust dependency and linking it in is not possible. Thanks for your input |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If this Wasm file is using I'm assuming you want to use Wasm files provided by a client and use them in your Wasm application that is running in a browser. I recommend you to look into |
Beta Was this translation helpful? Give feedback.
wasm-bindgen
doesn't offer this functionality, no.If this Wasm file is using
wasm-bindgen
, it won't work properly if you don't run it throughwasm-bindgen
and don't have it's JS shim anyway. How do you intend to solve that in the first place?I'm assuming you want to use Wasm files provided by a client and use them in your Wasm application that is running in a browser.
Unfortunately there isn't an easy way to do this right now, but what you need is an FFI interface that both you and t…