-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support for Maps #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
A good question! I think this is probably best done for now through something like #96 and the API would use JsValue, but would that still be too cumbersome? |
Ok I'm gonna close this in favor of #96 as I think that's probably the route we'd take for this, but thanks for the report! |
I think it would be worth supporting the limited case of string to string maps. A handful of web APIs use them, for instance Headers and URLSearchParams. |
@couchand in both those cases though those are dedicated classes, right? I'd imagine we'd want native bindings to them and then perhaps a helper method to convert them to a map on the Rust side? |
Unfortunately, I don't think dedicated classes would work there, since they have arbitrary keys. |
Ah if that's the case then yeah we may need to add some more support for more maps in the future as well! |
Is it planned to support Maps or other JavaScript data types in wasm-bindgen? For example,
I would like to be able to bind a function that returns a
BTreeMap<String, String>
(unless there is a more appropriate type for maps—I'm relatively new to Rust).The text was updated successfully, but these errors were encountered: