This is the unpublished documentation of wasm-bindgen, the published documentation is available on the main Rust and WebAssembly documentation site . Features documented here may not be available in released versions of wasm-bindgen.


T parameter &T parameter &mut T parameter T return value Option<T> parameter Option<T> return value JavaScript representation
Yes No No Yes No No A JavaScript string value

Example Rust Usage

# #![allow(unused_variables)]
#fn main() {
use wasm_bindgen::prelude::*;

pub fn take_char_by_value(x: char) {}

pub fn return_char() -> char {


Example JavaScript Usage

import {
} from './guide_supported_types_examples';


let c = return_char();
console.log(typeof c); // "string"