smol_str

Trait StrExt

Source
pub trait StrExt: Sealed {
    // Required methods
    fn to_lowercase_smolstr(&self) -> SmolStr;
    fn to_uppercase_smolstr(&self) -> SmolStr;
    fn to_ascii_lowercase_smolstr(&self) -> SmolStr;
    fn to_ascii_uppercase_smolstr(&self) -> SmolStr;
    fn replace_smolstr(&self, from: &str, to: &str) -> SmolStr;
    fn replacen_smolstr(&self, from: &str, to: &str, count: usize) -> SmolStr;
}
Expand description

str methods producing SmolStrs.

Required Methods§

Source

fn to_lowercase_smolstr(&self) -> SmolStr

Returns the lowercase equivalent of this string slice as a new SmolStr, potentially without allocating.

See str::to_lowercase.

Source

fn to_uppercase_smolstr(&self) -> SmolStr

Returns the uppercase equivalent of this string slice as a new SmolStr, potentially without allocating.

See str::to_uppercase.

Source

fn to_ascii_lowercase_smolstr(&self) -> SmolStr

Returns the ASCII lowercase equivalent of this string slice as a new SmolStr, potentially without allocating.

See str::to_ascii_lowercase.

Source

fn to_ascii_uppercase_smolstr(&self) -> SmolStr

Returns the ASCII uppercase equivalent of this string slice as a new SmolStr, potentially without allocating.

See str::to_ascii_uppercase.

Source

fn replace_smolstr(&self, from: &str, to: &str) -> SmolStr

Replaces all matches of a &str with another &str returning a new SmolStr, potentially without allocating.

See str::replace.

Source

fn replacen_smolstr(&self, from: &str, to: &str, count: usize) -> SmolStr

Replaces first N matches of a &str with another &str returning a new SmolStr, potentially without allocating.

See str::replacen.

Implementations on Foreign Types§

Source§

impl StrExt for str

Implementors§