#dom #emscripten #api #js #platform #web #cross-compiled

bin+lib webbing

APIs for the web platform for cross-compiled Rust to JS

1 unstable release

Uses old Rust 2015

0.1.0 Oct 12, 2017

#14 in #emscripten

MIT/Apache

2.5MB
64K SLoC

JavaScript 64K SLoC // 0.0% comments Rust 480 SLoC

Webbing: DOM APIs for Rust
Crate Info Documentation

A Rust library for use with emscripten to access the DOM.

Read the documentation, read brson's post on how Rust works with emscripten, or see an example app with rust-todomvc.

extern crate webbing;

fn main() {
    let document = webbing::init();
    let body = document.element_query("body").unwrap();
    body.html_set("<h1>HELLO FROM RUST</h1> <button>CLICK ME</button>");
    let button = document.element_query("button").unwrap();
    button.on("click", |_| webbing::alert("WITNESS ME"));
}

Used with cargo build --target=asmjs-unknown-emscripten.

License

MIT or Apache-2.0, at your option. A fork of the original rust-webplatform.

Dependencies