pub trait ToUppercase {
// Required methods
fn is_uppercase(&self) -> bool;
fn is_ascii_uppercase(&self) -> bool;
fn to_uppercase_cow(&self) -> Cow<'_, str>;
fn to_ascii_uppercase_cow(&self) -> Cow<'_, str>;
}Available on crate feature
alloc only.Expand description
To extend types which implement AsRef<str> to have is_uppercase, is_ascii_uppercase, to_uppercase_cow and to_ascii_uppercase_cow methods.
Required Methods§
Sourcefn is_uppercase(&self) -> bool
fn is_uppercase(&self) -> bool
Returns true if all characters in the string are uppercase according to Unicode.
Sourcefn is_ascii_uppercase(&self) -> bool
fn is_ascii_uppercase(&self) -> bool
Returns true if all characters in the string are ASCII uppercase.
Sourcefn to_uppercase_cow(&self) -> Cow<'_, str>
fn to_uppercase_cow(&self) -> Cow<'_, str>
Converts the string to its uppercase form (Unicode-aware), returning a Cow<str> to avoid allocation when possible.
Sourcefn to_ascii_uppercase_cow(&self) -> Cow<'_, str>
fn to_ascii_uppercase_cow(&self) -> Cow<'_, str>
Converts the string to its ASCII uppercase form, returning a Cow<str> to avoid allocation when possible.