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
Currently #[wasm_bindgen] on async fn seems to only accept types that are Into<JsValue>, but many wasm-bindgen types are only IntoWasmAbi, making it hard to convert synchronous code into asynchronous.
Steps to Reproduce
Try to compile code like following:
use wasm_bindgen::Clamped;#[wasm_bindgen]pubfnfoo() -> Clamped<Vec<u8>>{Clamped(vec![])}#[wasm_bindgen]pubasyncfnfoo() -> Clamped<Vec<u8>>{Clamped(vec![])}
Expected Behavior
Both functions compile successfully and generate their bindings.
Actual Behavior
Second function fails to compile due to:
| #[wasm_bindgen]
| ^^^^^^^^^^^^^^^ the trait `From<Clamped<Vec<u8>>>` is not implemented for `JsValue`
sdykae, SpiralP, frantisekhanzlikbl, DCNick3, MOZGIII and 1 more