pub trait HStringExt {
// Required methods
fn as_safely_truncated_wide(&self, target_len: usize) -> &[u16];
fn write_truncated(&self, buf: &mut [u16]);
}Required Methods§
Sourcefn as_safely_truncated_wide(&self, target_len: usize) -> &[u16]
fn as_safely_truncated_wide(&self, target_len: usize) -> &[u16]
Similar to HSTRING::as_wide(), but truncates the slice to the specified length, avoiding to cut a UTF-16 surrogate pair in half by reducing the length by one additional wide char, if needed.
With a target length larger than the string length, the behavior is identical to that of as_wide().
Sourcefn write_truncated(&self, buf: &mut [u16])
fn write_truncated(&self, buf: &mut [u16])
Writes the HSTRING into the buffer, followed by a terminating null character.