Skip to content

chrysn-pull-requests/rust-webplatform

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-webplatform

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

NOTE: Looking for maintainers. Please ping me on Twitter @trimryan or in the issues section to volunteer!

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

extern crate webplatform;

fn main() {
    let document = webplatform::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", |_| webplatform::alert("WITNESS ME"));
}

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

License

MIT or Apache-2.0, at your option.

About

Rust library for Emscripten-compiled JS apps.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.9%
  • Other 1.1%