pub struct Str { /* private fields */ }Implementations§
Source§impl Str
impl Str
pub fn of(s: impl Into<String>) -> Self
pub fn slug(self) -> Self
pub fn snake(self) -> Self
pub fn camel(self) -> Self
pub fn pascal(self) -> Self
pub fn kebab(self) -> Self
pub fn title(self) -> Self
pub fn upper(self) -> Self
pub fn lower(self) -> Self
pub fn trim(self) -> Self
pub fn ltrim(self) -> Self
pub fn rtrim(self) -> Self
pub fn squish(self) -> Self
pub fn truncate(self, limit: usize) -> Self
pub fn reverse(self) -> Self
pub fn repeat(self, times: usize) -> Self
pub fn append(self, s: &str) -> Self
pub fn prepend(self, s: &str) -> Self
pub fn replace(self, from: &str, to: &str) -> Self
pub fn replace_first(self, from: &str, to: &str) -> Self
pub fn replace_last(self, from: &str, to: &str) -> Self
pub fn finish(self, cap: &str) -> Self
pub fn ensure_start(self, prefix: &str) -> Self
pub fn wrap(self, before: &str, after: &str) -> Self
pub fn pad_left(self, n: usize) -> Self
pub fn pad_right(self, n: usize) -> Self
pub fn pad_both(self, n: usize) -> Self
pub fn mask(self, mask_char: char, from: usize) -> Self
pub fn escape_html(self) -> Self
pub fn when(self, condition: bool, f: impl FnOnce(Self) -> Self) -> Self
pub fn when_empty(self, f: impl FnOnce(Self) -> Self) -> Self
pub fn when_not_empty(self, f: impl FnOnce(Self) -> Self) -> Self
pub fn when_contains(self, needle: &str, f: impl FnOnce(Self) -> Self) -> Self
pub fn when_starts_with( self, prefix: &str, f: impl FnOnce(Self) -> Self, ) -> Self
pub fn when_ends_with(self, suffix: &str, f: impl FnOnce(Self) -> Self) -> Self
pub fn tap(self, f: impl FnOnce(&str)) -> Self
pub fn pipe<F: FnOnce(String) -> String>(self, f: F) -> Self
pub fn to_string(self) -> String
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, needle: &str) -> bool
pub fn starts_with(&self, prefix: &str) -> bool
pub fn ends_with(&self, suffix: &str) -> bool
pub fn word_count(&self) -> usize
pub fn to_base64(self) -> String
pub fn split(self, delimiter: &str) -> Vec<String>
pub fn exactly(&self, other: &str) -> bool
pub fn value(self) -> String
Trait Implementations§
impl Eq for Str
impl Send for Str
impl StructuralPartialEq for Str
impl Sync for Str
Auto Trait Implementations§
impl Freeze for Str
impl RefUnwindSafe for Str
impl Unpin for Str
impl UnsafeUnpin for Str
impl UnwindSafe for Str
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