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§
Sourcefn is_lowercase(&self) -> bool
fn is_lowercase(&self) -> bool
Returns true if all characters in the string are lowercase according to Unicode.
Sourcefn is_ascii_lowercase(&self) -> bool
fn is_ascii_lowercase(&self) -> bool
Returns true if all characters in the string are ASCII lowercase.
Sourcefn to_lowercase_cow(&self) -> Cow<'_, str>
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.
Sourcefn to_ascii_lowercase_cow(&self) -> Cow<'_, str>
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.