pub struct Utf16String { /* private fields */ }Expand description
An owned UTF-16 string 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 Utf16String
impl Utf16String
pub fn new() -> Self
pub fn as_mut_utf16_str(&mut self) -> &mut Utf16Str
pub unsafe fn as_mut_vec(&mut self) -> &mut Vec<u16>
pub fn clear(&mut self)
pub fn insert(&mut self, index: usize, ch: char)
pub fn insert_utf16_str(&mut self, index: usize, string: &Utf16Str)
pub fn insert_utf8_str(&mut self, index: usize, string: &str)
pub fn push(&mut self, ch: char)
pub fn push_utf16_str(&mut self, string: &Utf16Str)
pub fn push_utf8_str(&mut self, string: &str)
Methods from Deref<Target = Utf16Str>§
pub fn as_ptr(&self) -> *const u16
pub fn as_mut_ptr(&mut self) -> *mut u16
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.
pub fn get<I: SliceIndex<Utf16Str>>( &self, index: I, ) -> Option<&<I as SliceIndex<Utf16Str>>::Output>
pub fn get_mut<I: SliceIndex<Utf16Str>>( &mut self, index: I, ) -> Option<&mut <I as SliceIndex<Utf16Str>>::Output>
pub unsafe fn get_unchecked<I: SliceIndex<Utf16Str>>( &self, index: I, ) -> &<I as SliceIndex<Utf16Str>>::Output
pub unsafe fn get_unchecked_mut<I: SliceIndex<Utf16Str>>( &mut self, index: I, ) -> &mut <I as SliceIndex<Utf16Str>>::Output
pub fn is_empty(&self) -> bool
pub fn to_owned(&self) -> Utf16String
pub fn to_utf8(&self) -> String
pub fn to_lowercase(&self) -> Utf16String
pub fn to_uppercase(&self) -> Utf16String
Trait Implementations§
Source§impl Debug for Utf16String
impl Debug for Utf16String
Source§impl Default for Utf16String
impl Default for Utf16String
Source§impl Deref for Utf16String
impl Deref for Utf16String
Source§impl DerefMut for Utf16String
impl DerefMut for Utf16String
Source§impl From<Utf16String> for String
impl From<Utf16String> for String
Source§fn from(value: Utf16String) -> Self
fn from(value: Utf16String) -> Self
Converts to this type from the input type.
Source§impl Hash for Utf16String
impl Hash for Utf16String
Source§impl<I> Index<I> for Utf16Stringwhere
I: SliceIndex<Utf16Str>,
impl<I> Index<I> for Utf16Stringwhere
I: SliceIndex<Utf16Str>,
Source§impl<I> IndexMut<I> for Utf16Stringwhere
I: SliceIndex<Utf16Str>,
impl<I> IndexMut<I> for Utf16Stringwhere
I: SliceIndex<Utf16Str>,
Source§impl PartialEq for Utf16String
impl PartialEq for Utf16String
Source§fn eq(&self, other: &Utf16String) -> bool
fn eq(&self, other: &Utf16String) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for Utf16String
impl StructuralPartialEq for Utf16String
Auto Trait Implementations§
impl Freeze for Utf16String
impl RefUnwindSafe for Utf16String
impl Send for Utf16String
impl Sync for Utf16String
impl Unpin for Utf16String
impl UnsafeUnpin for Utf16String
impl UnwindSafe for Utf16String
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more