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§