pub struct CaseMapping { /* private fields */ }
Expand description

A struct with the ability to convert characters and strings to uppercase or lowercase, or fold them to a normalized form for case-insensitive comparison.

🚧 This code is experimental; it may change at any time, in breaking or non-breaking ways, including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature of the icu meta-crate. Use with caution. #2535

Implementations

A constructor which takes a DataProvider and creates a CaseMapping.

TODO before stabilitzation: make this return a crate-scoped error.

A constructor which takes a DataProvider and creates a CaseMapping for the given locale.

TODO before stabilitzation: make this return a crate-scoped error.

Creates a new CaseMapping using data exported by the icuexportdata tool in ICU4C. Validates that the data is consistent.

Returns the lowercase mapping of the given char. This function only implements simple and common mappings. Full mappings, which can map one char to a string, are not included. For full mappings, use CaseMapping::to_full_lowercase.

Returns the uppercase mapping of the given char. This function only implements simple and common mappings. Full mappings, which can map one char to a string, are not included. For full mappings, use CaseMapping::to_full_uppercase.

Returns the titlecase mapping of the given char. This function only implements simple and common mappings. Full mappings, which can map one char to a string, are not included.

Returns the simple case folding mapping of the given char. For full mappings, use CaseMapping::full_fold.

Returns the simple case folding mapping of the given char, using Turkic (T) mappings for dotted/dotless i. This function does not fold i and I to the same character. Instead, I will fold to ı, and İ will fold to i. Otherwise, this is the same as CaseMapping::fold().

Returns the full lowercase mapping of the given string. This function is context and locale sensitive.

Returns the full uppercase mapping of the given string. This function is context and locale sensitive.

Case-folds the characters in the given string. This function is locale-independent and context-insensitive.

Case-folds the characters in the given string, using Turkic (T) mappings for dotted/dotless I. This function is locale-independent and context-insensitive.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.