char
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)] fn main() { use wasm_bindgen::prelude::*; #[wasm_bindgen] pub fn take_char_by_value(x: char) {} #[wasm_bindgen] pub fn return_char() -> char { '🚀' } }
Example JavaScript Usage
import {
take_char_by_value,
return_char,
} from './guide_supported_types_examples';
take_char_by_value('a');
let c = return_char();
console.log(typeof c); // "string"