ToLowercase

Trait ToLowercase 

Source
pub trait ToLowercase {
    // Required methods
    fn is_lowercase(&self) -> bool;
    fn is_ascii_lowercase(&self) -> bool;
    fn to_lowercase_cow(&self) -> Cow<'_, str>;
    fn to_ascii_lowercase_cow(&self) -> Cow<'_, str>;
}
Available on crate feature alloc only.
Expand description

To extend types which implement AsRef<str> to have is_lowercase, is_ascii_lowercase, to_lowercase_cow and to_ascii_lowercase_cow methods.

Required Methods§

Source

fn is_lowercase(&self) -> bool

Returns true if all characters in the string are lowercase according to Unicode.

Source

fn is_ascii_lowercase(&self) -> bool

Returns true if all characters in the string are ASCII lowercase.

Source

fn to_lowercase_cow(&self) -> Cow<'_, str>

Converts the string to its lowercase form (Unicode-aware), returning a Cow<str> to avoid allocation when possible.

Source

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

Converts the string to its ASCII lowercase form, returning a Cow<str> to avoid allocation when possible.

Implementors§

Source§

impl<T: AsRef<str>> ToLowercase for T