pub struct Utf16Str { /* private fields */ }Expand description
A UTF-16 string slice consisting of UCS-2 code units.
Indexing this type is equivalent to indexing UTF-16 code units (not bytes),
which are represented by u16.
Implementations§
Source§impl Utf16Str
impl Utf16Str
pub fn as_ptr(&self) -> *const u16
pub fn as_mut_ptr(&mut self) -> *mut u16
pub unsafe fn from_utf16_unchecked(raw: &[u16]) -> &Self
pub unsafe fn from_utf16_unchecked_mut(raw: &mut [u16]) -> &mut Self
Sourcepub fn code_units(&self) -> Iter<'_, u16>
pub fn code_units(&self) -> Iter<'_, u16>
Iterates the UTF-16 code units.
Sourcepub fn chars(&self) -> Utf16Chars<'_> ⓘ
pub fn chars(&self) -> Utf16Chars<'_> ⓘ
Iterates the code points in the string.
Sourcepub fn char_indices(&self) -> Utf16CharIndices<'_> ⓘ
pub fn char_indices(&self) -> Utf16CharIndices<'_> ⓘ
Iterates the indices and their code pointss in the string.