wasmtime-wasi-usb
A Wasmtime host implementation of wasi-usb, enabling WebAssembly components to interact with USB devices through the wasi-usb interface.
Use this crate to add wasi-usb support to any Wasmtime embedder.
Usage
Add the dependency to your Cargo.toml:
[]
= "44.0.0" # specify desired version
Integrating into a Wasmtime embedder
Implement the WasiUsbView trait for your host state and register the interfaces with the linker:
use Linker;
use ResourceTable;
use ;
Create the USB context when initializing your state. Pass true or false to enable or disable USB hotplug support:
let usb_ctx = new;
License
This project is licensed under the MIT License.
This work has been partially supported by the ELASTIC project, which received funding from the Smart Networks and Services Joint Undertaking (SNS JU) under the European Union’s Horizon Europe research and innovation programme under Grant Agreement No 101139067. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union. Neither the European Union nor the granting authority can be held responsible for them.