HStringExt

Trait HStringExt 

Source
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§