You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, when calling a function exported by wasm-bindgen, there's no way to convert to Rust structs without creating a class instance of the exported wasm-bindgen type.
Calling without creating a class instance is needed in cases where a class instance cannot be created, such as when interfacing with existing code is needed.
Use imported types with duck typing. Type imports with duck typing don't always work though. In my case, this is shared code and I need everything to also be usable from rust
The text was updated successfully, but these errors were encountered:
Motivation
At the moment, when calling a function exported by wasm-bindgen, there's no way to convert to Rust structs without creating a class instance of the exported wasm-bindgen type.
Calling without creating a class instance is needed in cases where a class instance cannot be created, such as when interfacing with existing code is needed.
Proposed Solution
Given the following code
The following call should be possible
See #3468 (comment)
Alternatives
Use imported types with duck typing. Type imports with duck typing don't always work though. In my case, this is shared code and I need everything to also be usable from rust
The text was updated successfully, but these errors were encountered: