Skip to content

WebUSB backend #83

@kevinmehall

Description

@kevinmehall

https://github.com/G2-Games/cross-usb wraps nusb and WebUSB with a subset of the API, but WebUSB could be an nusb backend in-tree instead of requiring a wrapper library.

This is probably not something I'll get to soon, but the API implications are worth considering, mainly that all WebUSB operations are async, while nusb currently has many blocking methods where the underlying OS operations are blocking.

For non-Wasm, it looks like cross_usb just calls the nusb blocking methods from an async fn, blocking the async runtime. Probably fine for a lot of use cases, but not ideal if your application is primarily async. Doing that right would require depending on blocking or tokio::spawn_blocking. So far nusb has managed to avoid depending on an async executor.

(cc @G2-Games)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions