Skip to content

web-sys: arrayBuffer function on Blob API #1983

Closed
@anlumo

Description

@anlumo

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions