Expand description
This module provides a data structure for an time-efficient lookup of values associated to code points.
It is an implementation of the existing ICU4C UCPTrie / ICU4J CodePointTrie API.
§Architecture
ICU4X CodePointTrie is designed to provide a read-only view of CodePointTrie data that is exported
from ICU4C. Detailed information about the design of the data structure can be found in the documentation
for the CodePointTrie struct.
§Examples
§Querying a CodePointTrie
use icu::collections::codepointtrie::planes;
let trie = planes::get_planes_trie();
assert_eq!(0, trie.get32(0x41)); // 'A' as u32
assert_eq!(0, trie.get32(0x13E0)); // 'Ꮰ' as u32
assert_eq!(1, trie.get32(0x10044)); // '𐁄' as u32Modules§
- planes
- Sample data for
CodePointTriethat returns the code point’s plane number.
Structs§
- Code
Point MapRange - Represents a range of consecutive code points sharing the same value in a code point map.
- Code
Point MapRange Iterator - A custom
Iteratortype specifically for a code point trie that returnsCodePointMapRanges. - Code
Point Trie - This struct represents a de-serialized
CodePointTriethat was exported from ICU binary data. - Code
Point Trie Header - This struct contains the fixed-length header fields of a
CodePointTrie. - Fast
Code Point Trie - Type-safe wrapper for a fast trie guaranteeing
the the getters don’t branch on the trie type
and for guarenteeing that
get16is branchless in release builds. - Small
Code Point Trie - Type-safe wrapper for a small trie guaranteeing the the getters don’t branch on the trie type.
Enums§
- Code
Point Trie Error - A custom error type for
CodePointTrie. - Trie
Type - The type of trie represents whether the trie has an optimization that would make it smaller or faster.
- Typed
- Holder for either fast or small trie with the trie type encoded into the Rust type.
Traits§
- Trie
Value - A trait representing the values stored in the data array of a
CodePointTrie. This trait is used as a type parameter in constructing aCodePointTrie. - Typed
Code Point Trie - Trait for writing trait bounds for monomorphizing over either
FastCodePointTrieorSmallCodePointTrie.