io_devices_lib Rust
Rust crate for building applications using the Wasmer Experimental IO Devices. 🔌
Features
- Supports the Wasmer Framebuffers, so you can use WASI Modules to draw graphics! 🖼️
- Supports Keyboard and Mouse Input APIs, so you can retrieve and use Input! ⌨️🐭
Installation
Add wasmer-experimental-io-devices-lib = "0.1"
to your [dependencies]
in your Cargo.toml
Quick Start
TODO(mark): restructure io-devices-lib so that current stuff is namespaced under framebuffer
The program below demonstrates how to use this API to create an interactive framebuffer application.
use iter;
use ;
const X_RES: u32 = 300;
const Y_RES: u32 = 300;
Inside your crate, just run cargo build --release --target=wasm32-wasi
to compile.
Check your version of wasmer with wasmer -V
, if you haven't updated to version 0.12.0 or higher yet, run wasmer self-update
.
Then, run wasmer run --enable-experimental-io-devices target/wasm32-wasi/release/wasm-module-name.wasm
.
TODO: add screenshot