ToUppercase

Trait ToUppercase 

Source
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§

Source

fn is_uppercase(&self) -> bool

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

Source

fn is_ascii_uppercase(&self) -> bool

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

Source

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.

Source

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.

Implementors§

Source§

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