pub struct Utf16Str(/* private fields */);
Expand description
UTF-16 string slice.
Implementations§
source§impl Utf16Str
impl Utf16Str
sourcepub fn from_utf16(utf16: &[u16]) -> Result<&Utf16Str, DecodeUtf16Error>
pub fn from_utf16(utf16: &[u16]) -> Result<&Utf16Str, DecodeUtf16Error>
Convert a slice of u16
to a UTF-16 string slice.
sourcepub unsafe fn from_utf16_unchecked(utf16: &[u16]) -> &Utf16Str
pub unsafe fn from_utf16_unchecked(utf16: &[u16]) -> &Utf16Str
Converts a slice of bytes to a Utf16Str
without validating that the slice
contains valid UTF-16 encoded data.