pub struct PopulatedStr(/* private fields */);Implementations§
Source§impl PopulatedStr
impl PopulatedStr
pub const fn from_str_panic_if_empty(str: &str) -> &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<&PopulatedStr> for String
impl Add<&PopulatedStr> for String
Source§type Output = PopulatedString
type Output = PopulatedString
+ operator.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 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 AsRef<str> for PopulatedStr
impl AsRef<str> for PopulatedStr
Source§impl Borrow<PopulatedStr> for PopulatedString
impl Borrow<PopulatedStr> for PopulatedString
Source§fn borrow(&self) -> &PopulatedStr
fn borrow(&self) -> &PopulatedStr
Source§impl Borrow<str> for PopulatedStr
impl Borrow<str> for 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 Debug for PopulatedStr
impl Debug for PopulatedStr
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 PopulatedStr> for String
impl<'a> Extend<&'a PopulatedStr> for String
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> From<&'a PopulatedStr> for &'a str
impl<'a> From<&'a PopulatedStr> for &'a str
Source§fn from(populated_str: &'a PopulatedStr) -> &'a str
fn from(populated_str: &'a PopulatedStr) -> &'a str
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<'a> From<&'a mut PopulatedStr> for &'a mut str
impl<'a> From<&'a mut PopulatedStr> for &'a mut str
Source§fn from(populated_str: &'a mut PopulatedStr) -> &'a mut str
fn from(populated_str: &'a mut PopulatedStr) -> &'a mut str
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.