pub struct PopulatedString(/* private fields */);Implementations§
Source§impl PopulatedString
impl PopulatedString
pub fn as_str(&self) -> &PopulatedStr
pub fn as_mut_str(&mut self) -> &mut PopulatedStr
pub fn push_str(&mut self, string: &str)
pub fn pushed_str(string: String, other: &PopulatedStr) -> PopulatedString
pub fn capacity(&self) -> NonZeroUsize
pub fn push(&mut self, ch: char)
pub fn pushed(string: String, ch: char) -> PopulatedString
pub fn pop(self) -> (String, char)
pub fn insert(&mut self, index: usize, ch: char)
pub fn inserted(string: String, index: usize, ch: char) -> PopulatedString
pub fn insert_str(&mut self, index: usize, string: &str)
pub fn inserted_str( string: String, index: usize, other: &PopulatedStr, ) -> PopulatedString
pub fn len(&self) -> NonZeroUsize
pub fn split_off(&mut self, at: NonZeroUsize) -> String
pub fn split_at_into(self, at: usize) -> (String, String)
pub fn clear(self) -> String
pub fn replace_range( &mut self, range: impl RangeBounds<usize>, replace_with: &PopulatedStr, )
Methods from Deref<Target = PopulatedStr>§
pub fn as_str(&self) -> &str
Sourcepub fn len(&self) -> NonZeroUsize
pub fn len(&self) -> NonZeroUsize
Returns the length of self.
This length is in bytes, not chars or graphemes. In other words, it might not be what a human considers the length of the string.
pub fn is_char_boundary(&self, index: usize) -> bool
pub fn split_at_populated(&self, mid: NonZeroUsize) -> (&PopulatedStr, &str)
pub fn split_at(&self, mid: usize) -> (&str, &str)
Sourcepub fn chars(&self) -> Chars<'_>
pub fn chars(&self) -> Chars<'_>
Returns a populated iterator over the chars of a string slice.
Sourcepub fn to_lowercase(&self) -> PopulatedString
pub fn to_lowercase(&self) -> PopulatedString
Returns the lowercase equivalent of this PopulatedStr slice, as a new PopulatedString.
‘Lowercase’ is defined according to the terms of the Unicode Derived Core Property
Lowercase.
Since some characters can expand into multiple characters when changing the case, this
function returns a PopulatedString instead of modifying the parameter in-place.
Sourcepub fn to_uppercase(&self) -> PopulatedString
pub fn to_uppercase(&self) -> PopulatedString
Returns the uppercase equivalent of this PopulatedStr slice, as a new PopulatedString.
‘Uppercase’ is defined according to the terms of the Unicode Derived Core Property
Uppercase.
Since some characters can expand into multiple characters when changing the case, this
function returns a PopulatedString instead of modifying the parameter in-place.
Sourcepub fn repeat(&self, n: NonZeroUsize) -> PopulatedString
pub fn repeat(&self, n: NonZeroUsize) -> PopulatedString
Creates a new PopulatedString by repeating a string n times. n must be greater than
0 to preserve populatedness.
Sourcepub fn trim(&self) -> &str
pub fn trim(&self) -> &str
Returns a string slice with leading and trailing whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space, which includes newlines.
Sourcepub fn trim_start(&self) -> &str
pub fn trim_start(&self) -> &str
Returns a string slice with leading whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property White_Space, which includes newlines.
Trait Implementations§
Source§impl Add<&str> for PopulatedString
impl Add<&str> for PopulatedString
Source§impl AddAssign<&PopulatedStr> for PopulatedString
impl AddAssign<&PopulatedStr> for PopulatedString
Source§fn add_assign(&mut self, other: &PopulatedStr)
fn add_assign(&mut self, other: &PopulatedStr)
+= operation. Read moreSource§impl AddAssign<&str> for PopulatedString
impl AddAssign<&str> for PopulatedString
Source§fn add_assign(&mut self, other: &str)
fn add_assign(&mut self, other: &str)
+= operation. Read moreSource§impl AsMut<PopulatedStr> for PopulatedString
impl AsMut<PopulatedStr> for PopulatedString
Source§fn as_mut(&mut self) -> &mut PopulatedStr
fn as_mut(&mut self) -> &mut PopulatedStr
Source§impl AsRef<PopulatedStr> for PopulatedString
impl AsRef<PopulatedStr> for PopulatedString
Source§fn as_ref(&self) -> &PopulatedStr
fn as_ref(&self) -> &PopulatedStr
Source§impl Borrow<PopulatedStr> for PopulatedString
impl Borrow<PopulatedStr> for PopulatedString
Source§fn borrow(&self) -> &PopulatedStr
fn borrow(&self) -> &PopulatedStr
Source§impl BorrowMut<PopulatedStr> for PopulatedString
impl BorrowMut<PopulatedStr> for PopulatedString
Source§fn borrow_mut(&mut self) -> &mut PopulatedStr
fn borrow_mut(&mut self) -> &mut PopulatedStr
Source§impl Clone for PopulatedString
impl Clone for PopulatedString
Source§fn clone(&self) -> PopulatedString
fn clone(&self) -> PopulatedString
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PopulatedString
impl Debug for PopulatedString
Source§impl Deref for PopulatedString
impl Deref for PopulatedString
Source§impl DerefMut for PopulatedString
impl DerefMut for PopulatedString
Source§impl<'a> Extend<&'a PopulatedStr> for PopulatedString
impl<'a> Extend<&'a PopulatedStr> for PopulatedString
Source§fn extend<T: IntoIterator<Item = &'a PopulatedStr>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = &'a PopulatedStr>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<'a> Extend<&'a str> for PopulatedString
impl<'a> Extend<&'a str> for PopulatedString
Source§fn extend<T: IntoIterator<Item = &'a str>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = &'a str>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl From<&PopulatedStr> for PopulatedString
impl From<&PopulatedStr> for PopulatedString
Source§fn from(populated_str: &PopulatedStr) -> PopulatedString
fn from(populated_str: &PopulatedStr) -> PopulatedString
Source§impl From<PopulatedString> for String
impl From<PopulatedString> for String
Source§fn from(populated_string: PopulatedString) -> String
fn from(populated_string: PopulatedString) -> String
Source§impl<'a> FromPopulatedIterator<&'a PopulatedStr> for PopulatedString
impl<'a> FromPopulatedIterator<&'a PopulatedStr> for PopulatedString
Source§fn from_populated_iter(
iter: impl IntoPopulatedIterator<Item = &'a PopulatedStr>,
) -> Self
fn from_populated_iter( iter: impl IntoPopulatedIterator<Item = &'a PopulatedStr>, ) -> Self
PopulatedIterator into Self.