Skip to main content

write_submilli_string_struct_units

Function write_submilli_string_struct_units 

Source
pub fn write_submilli_string_struct_units(
    caller: &mut Caller<'_, StoreData>,
    units: &[u16],
) -> Result<Rooted<StructRef>>
Expand description

Build a real $string directly from UTF-16 code units — the surrogate-faithful path for callers (e.g. String.fromCharCode) whose output may contain lone surrogates that a Rust String can’t carry. Requires StoreData::host_abi, set once the prelude instantiates.