pub fn from_str<V: WasmValue>(ty: &V::Type, s: &str) -> Result<V, ParserError>
Expand description
Parses a WasmValue
from the given WAVE-encoded string.
use wasm_wave::{wasm::WasmValue, value::{Type, Value}};
let val: Value = wasm_wave::from_str(&Type::CHAR, r"'\u{1F44B}'")?;
assert_eq!(val, Value::make_char('👋'));