/emval-rs

Primary LanguageRustMozilla Public License 2.0MPL-2.0

emval-rs

A rust wrapper for emscripten val.h

Using val.h, the Javascript code can be called from rust.

Usage

extern crate emval;
use emval::*;

let window = JSObj::global("window");
let name: String = window.call_prop("prompt", args!("What is your name?"));
window.call_prop::<()>("alert", args!(format!("Hi, {} from rust!", name)));

build

$ EMMAKEN_CFLAGS=--bind cargo build --target=asmjs-unknown-emscripten