Trait Utf16StrExt

Source
pub trait Utf16StrExt {
    // Required methods
    fn utf8_length(&self) -> usize;
    fn create_str<'a>(
        &'a self,
        buffer: &'a mut [u8],
    ) -> Result<&'a str, SerializeError>;
}
Expand description

Extension trait for creating UTF-8 strings from UTF-16 strings.

Required Methods§

Source

fn utf8_length(&self) -> usize

Returns the number of bytes required to store this string as UTF-8.

Source

fn create_str<'a>( &'a self, buffer: &'a mut [u8], ) -> Result<&'a str, SerializeError>

Create a UTF-8 string from the UTF-16 encoded string in the provided buffer.

Implementors§

Source§

impl<T> Utf16StrExt for T
where T: Utf16Str,