pub trait HStringExt {
    // Required methods
    fn as_safely_truncated_wide(&self, target_len: usize) -> &[u16];
    fn write_truncated(&self, buf: &mut [u16]);
}

Required Methods§

source

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().

source

fn write_truncated(&self, buf: &mut [u16])

Writes the HSTRING into the buffer, followed by a terminating null character.

Implementations on Foreign Types§

source§

impl HStringExt for HSTRING

source§

fn as_safely_truncated_wide(&self, target_len: usize) -> &[u16]

source§

fn write_truncated(&self, buf: &mut [u16])

Implementors§