wasm-bindgen
wasm-bindgen copied to clipboard
Facilitating high-level interactions between Wasm modules and JavaScript
`#[wasm_bindgen]` fails if an enum variant has a `#[cfg(xxx)]` that evaluates to false Same thing with structs. wasm-bindgen = "0.2.59" ```rust use wasm_bindgen::prelude::*; #[wasm_bindgen] pub enum MyEnum { #[cfg(feature =...
The new Origin Private File System with the[ AccessHandle Proposal](https://github.com/WICG/file-system-access/blob/main/AccessHandle.md) is getting close to becoming a standard. Safari and Chromium browsers already support it, Firefox is prototyping it but with...
### Summary "cannot call wasm-bindgen imported functions on non-wasm targets" ### Additional Details * environment ``` rustup show Default host: x86_64-pc-windows-msvc rustup home: C:\Users\Asura7969\.rustup installed toolchains -------------------- stable-2022-01-20-x86_64-pc-windows-msvc stable-x86_64-pc-windows-msvc (default)...
### Describe the Bug the trait bound `Vec: RefFromWasmAbi` is not satisfied the trait `RefFromWasmAbi` is not implemented for `Vec`rustcE0277 the trait bound `Vec: RefMutFromWasmAbi` is not satisfied the trait...
### Description The `import` keyword can be called as a function for [dynamic imports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#dynamic_imports). This function is missing from the `js-sys` bindings. ### Solution Export `import` from `js-sys` ### Workaround...
Rust's Iterators underlie a lot of useful patterns, and it would be great to be able to express them to JS for natural interactions as iterables. This might be the...
### Motivation I am using the following pattern to efficiently initialize a large buffer inside wasm memory from JavaScript without copies (see #1079 for full motivation): ```rust #[wasm_bindgen] pub struct...
### Describe the Bug The JavaScript generated for an enum with a method references a non-existent function. ### Steps to Reproduce ```rust // lib.rs use wasm_bindgen::prelude::*; pub enum Foo {}...
Make attributes marked `[SetterThrows]` use a `set_*` function that returns a `Result`. Currently webidl only looks for a `[Throws]` attribute. I found this problem while writing an indexed DB wrapper....
### Summary I want to make a Web Component. How do I define my custom Web Component in the CustomElementRegistry? Specifically, how do I pass the constructor as a `&js_sys::Function`?...