Is it possible to give names to wrappers and helpers functions? #4108
Replies: 2 comments 4 replies
-
It is not possible. Why is this necessary though?
What does "dynamically created" mean in this context? |
Beta Was this translation helpful? Give feedback.
-
I mean that I have multiple modules that define the exports with the same interface: #[wasm_bindgen(js_name="test")]
pub async fn test(val: u32) {
}
#[wasm_bindgen(js_name="test_b")]
pub async fn test_b(val: u32) {
} So this create({imports}) {
// here is the code generated by wasm_bindgen
return {
init: __wbg_init,
test,
test_b
}
} So now I can create |
Beta Was this translation helpful? Give feedback.
-
So if I have some basic async function which I want to export:
This expands to some glue code both on Rust and on JS side. So something like this ends up in JS:
So the two key functions is
__wbg_adapter_14
and__wbg_adapter_26
:This functions calls some exported Rust functions.
So I want to know is it somehow possible to give static names to this helpers?
Or at least know that
__wbindgen_closure_wrapper32
-> will call_dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd633b0858f9c6e90
?Now each time this helpers created they will have random names, so the JS glue file can't be dynamically created.
Beta Was this translation helpful? Give feedback.
All reactions