Trait std::ascii::AsciiExtStable
[-] [+]
[src]
pub trait AsciiExt { type Owned; fn is_ascii(&self) -> bool; fn to_ascii_uppercase(&self) -> Self::Owned; fn to_ascii_lowercase(&self) -> Self::Owned; fn eq_ignore_ascii_case(&self, other: &Self) -> bool; fn make_ascii_uppercase(&mut self); fn make_ascii_lowercase(&mut self); }
Extension methods for ASCII-subset only operations on string slices
Associated Types
Required Methods
fn is_ascii(&self) -> bool
Check if within the ASCII range.
fn to_ascii_uppercase(&self) -> Self::Owned
Makes a copy of the string in ASCII upper case: ASCII letters 'a' to 'z' are mapped to 'A' to 'Z', but non-ASCII letters are unchanged.
fn to_ascii_lowercase(&self) -> Self::Owned
Makes a copy of the string in ASCII lower case: ASCII letters 'A' to 'Z' are mapped to 'a' to 'z', but non-ASCII letters are unchanged.
fn eq_ignore_ascii_case(&self, other: &Self) -> bool
Check that two strings are an ASCII case-insensitive match.
Same as to_ascii_lowercase(a) == to_ascii_lowercase(b)
,
but without allocating and copying temporary strings.
fn make_ascii_uppercase(&mut self)
Convert this type to its ASCII upper case equivalent in-place.
See to_ascii_uppercase
for more information.
fn make_ascii_lowercase(&mut self)
Convert this type to its ASCII lower case equivalent in-place.
See to_ascii_lowercase
for more information.