pub trait UnicodeNormalization {
// Required methods
fn nfc(&self) -> Cow<'_, str>;
fn nfd(&self) -> Cow<'_, str>;
fn nfkc(&self) -> Cow<'_, str>;
fn nfkd(&self) -> Cow<'_, str>;
fn is_nfc(&self) -> bool;
fn is_nfd(&self) -> bool;
fn is_nfkc(&self) -> bool;
fn is_nfkd(&self) -> bool;
}Expand description
Convenience trait for normalizing &str slices.
All methods return Cow<'_, str>, which is Cow::Borrowed when the input
is already in the target normalization form (zero allocation).
Required Methods§
Sourcefn nfc(&self) -> Cow<'_, str>
fn nfc(&self) -> Cow<'_, str>
Normalize to NFC (Canonical Decomposition, followed by Canonical Composition).