wasm-bindgen 0.2.46

Easy support for interacting between JS and Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;

#[wasm_bindgen(module = "/tests/headless/strings.js")]
extern "C" {
    fn test_string_roundtrip(c: &Closure<Fn(String) -> String>);
}

#[wasm_bindgen_test]
fn string_roundtrip() {
    test_string_roundtrip(&Closure::wrap(Box::new(|s| s)));
}