pub struct UnicodeString(pub Vec<char>);Expand description
A character-indexed string stored as a vector of chars, allowing
indexing and editing by Unicode scalar value rather than by byte offset.
Tuple Fields§
§0: Vec<char>Implementations§
Source§impl UnicodeString
impl UnicodeString
Sourcepub fn pop(&mut self) -> Option<char>
pub fn pop(&mut self) -> Option<char>
Removes and returns the last character, or None if the string is empty.
Sourcepub fn remove(&mut self, index: usize) -> char
pub fn remove(&mut self, index: usize) -> char
Removes and returns the character at the given index, shifting subsequent characters left.
Sourcepub fn is_not_empty(&self) -> bool
pub fn is_not_empty(&self) -> bool
Returns true if the string contains at least one character.
Sourcepub fn insert_char(&mut self, index: usize, c: char)
pub fn insert_char(&mut self, index: usize, c: char)
Inserts a single character at the given character index, shifting subsequent characters right.
Sourcepub fn insert(&mut self, index: usize, us: UnicodeString)
pub fn insert(&mut self, index: usize, us: UnicodeString)
Inserts all characters of us at the given character index, shifting subsequent characters right.
Sourcepub fn extend(&mut self, us: UnicodeString)
pub fn extend(&mut self, us: UnicodeString)
Appends all characters of us to the end of this string.
Trait Implementations§
Source§impl Clone for UnicodeString
impl Clone for UnicodeString
Source§fn clone(&self) -> UnicodeString
fn clone(&self) -> UnicodeString
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnicodeString
impl Debug for UnicodeString
Source§impl Default for UnicodeString
impl Default for UnicodeString
Source§fn default() -> UnicodeString
fn default() -> UnicodeString
Returns the “default value” for a type. Read more
Source§impl Display for UnicodeString
impl Display for UnicodeString
Source§impl From<&[char]> for UnicodeString
impl From<&[char]> for UnicodeString
Source§impl From<&str> for UnicodeString
impl From<&str> for UnicodeString
Source§impl From<String> for UnicodeString
impl From<String> for UnicodeString
Auto Trait Implementations§
impl Freeze for UnicodeString
impl RefUnwindSafe for UnicodeString
impl Send for UnicodeString
impl Sync for UnicodeString
impl Unpin for UnicodeString
impl UnsafeUnpin for UnicodeString
impl UnwindSafe for UnicodeString
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