Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 520 Bytes

README.md

File metadata and controls

23 lines (15 loc) · 520 Bytes

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