thy486
thy486
It's my idea. declare `foo` function in `#[wasm_bindgen]` extern, `wasm_bindgen` expose a function for import `foo` function (like `set_foo_ns`): ```rust #[wasm_bindgen] extern "C" { pub type NS; #[wasm_bindgen(method)] pub fn...
1. 请提供最小可复现案例 2. [你需要仔细阅读这篇文章](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md)
May be you can use enum: ```rust pub enum Position { Foo(Position1), Bar(Position2), } #[wasm_bindgen] pub struct WasmPosition { s: Position } ``` or dyn trait ```rust #[wasm_bindgen] pub struct...