StrLikeExtension

Trait StrLikeExtension 

Source
pub trait StrLikeExtension: ToOwned {
    // Required methods
    fn to_ascii_lowercase_cow(&self) -> Cow<'_, Self>;
    fn ascii_nat_cmp(&self, other: &Self) -> Ordering;
}

Required Methods§

Source

fn to_ascii_lowercase_cow(&self) -> Cow<'_, Self>

Returns the same value as String::to_lowercase. The only difference is that this functions returns Cow and does not allocate if the string is already in lowercase.

Source

fn ascii_nat_cmp(&self, other: &Self) -> Ordering

Compare two strings using a natural ASCII order.

Uppercase letters come first (e.g. A < a < B < b) and number are compared in a human way (e.g. 9 < 10).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl StrLikeExtension for str

Source§

fn to_ascii_lowercase_cow(&self) -> Cow<'_, Self>

Source§

fn ascii_nat_cmp(&self, other: &Self) -> Ordering

Source§

impl StrLikeExtension for OsStr

Source§

fn to_ascii_lowercase_cow(&self) -> Cow<'_, Self>

Source§

fn ascii_nat_cmp(&self, other: &Self) -> Ordering

Source§

impl StrLikeExtension for [u8]

Source§

fn to_ascii_lowercase_cow(&self) -> Cow<'_, Self>

Source§

fn ascii_nat_cmp(&self, other: &Self) -> Ordering

Implementors§