pub struct CaseMappingExceptions<'data> {
    pub slots: ZeroVec<'data, u16>,
    pub strings: VarZeroVec<'data, str, Index16>,
}
Expand description

This represents case mapping exceptions that can’t be represented as a delta applied to the original code point. Similar to ICU4C, data is stored as a u16 array. The codepoint trie in CaseMapping stores offsets into this array. The u16 at that index contains a set of flags describing the subsequent data.

[idx + 0] Header word: Bits: 0..7 Flag bits indicating which optional slots are present (if any): 0: Lowercase mapping (code point) 1: Case folding (code point) 2: Uppercase mapping (code point) 3: Titlecase mapping (code point) 4: Delta to simple case mapping (code point) (sign stored separately) 5: RESERVED 6: Closure mappings (string; see below) 7: Full mappings (strings; see below) 8 Double-width slots. If set, then each optional slot is stored as two elements of the array (high and low halves of 32-bit values) instead of a single element. 9 Has no simple case folding, even if there is a simple lowercase mapping 10 The value in the delta slot is negative 11 Is case-sensitive (not exposed) 12..13 Dot type 14 Has conditional special casing 15 Has conditional case folding

If double-width slots is false:

[idx + 1] First optional slot [idx + 2] Second optional slot [idx + 3] Third optional slot …

If double-width slots is true:

[idx + 1] First optional slot [idx + 3] Second optional slot [idx + 5] Third optional slot …

In ICU4C, the full mapping and closure strings are stored inline in the data, encoded as UTF-16, and the full mapping and closure slots contain information about the length of those strings. To avoid the need for allocations when converting from UTF-16 to UTF-8, we instead store strings encoded as UTF-8 in a side table. The full mapping and closure slots contain indices into that side table.

Fields

slots: ZeroVec<'data, u16>strings: VarZeroVec<'data, str, Index16>

Trait Implementations

Returns a TokenStream that would evaluate to self. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

This type MUST be Self with the 'static replaced with 'a, i.e. Self<'a>

This method must cast self between &'a Self<'static> and &'a Self<'a>. Read more

This method must cast self between Self<'static> and Self<'a>. Read more

This method can be used to cast away Self<'a>’s lifetime. Read more

This method must cast self between &'a mut Self<'static> and &'a mut Self<'a>, and pass it to f. Read more

Clone the other C into a struct that may retain references into C.

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.