wasm_wave

Function to_string

Source
pub fn to_string(val: &impl WasmValue) -> Result<String, WriterError>
Expand description

Returns the given WasmValue as a WAVE-encoded string.

use wasm_wave::{wasm::WasmValue, value::Value};
let wave_str = wasm_wave::to_string(&Value::make_char('\u{1F44B}'))?;
assert_eq!(wave_str, "'👋'");