Skip to content
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

web-sys: arrayBuffer function on Blob API #1983

Closed
anlumo opened this issue Jan 28, 2020 · 0 comments · Fixed by #2008
Closed

web-sys: arrayBuffer function on Blob API #1983

anlumo opened this issue Jan 28, 2020 · 0 comments · Fixed by #2008

Comments

@anlumo
Copy link

anlumo commented Jan 28, 2020

Motivation

Blob has an arrayBuffer function documented here. It's very convenient to use from Rust due to using Promises that can easily be converted to Futures, but it's not exposed in web-sys.

Proposed Solution

While it's not supported on all browsers, it would be great to have this function exposed by the crate.

Alternatives

Currently I'm using Reflect to get the function and call it directly, but this is a lot of code and probably also not as fast.

Alternatively, there's a callback-based API exposed as readAsArrayBuffer, but that's very cumbersome to use due to Rust's memory model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant