Module char16trie
This module provides a data structure for a space-efficient and time-efficient lookup of sequences of 16-bit units (commonly but not necessarily UTF-16 code units) which map to integer values.
It is an implementation of the existing ICU4C UCharsTrie / ICU4J CharsTrie API.
Architecture
ICU4X Char16Trie is designed to provide a read-only view of UCharsTrie data that is exported from ICU4C.
Examples
Querying a Char16Trie
use ;
use ZeroVec;
// A Char16Trie containing the ASCII characters mapping 'a' to 1 and 'ab'
// to 100.
let trie_data = ;
let trie = new;
let mut iter = trie.iter;
let res = iter.next;
assert_eq!;
let res = iter.next;
assert_eq!;
let res = iter.next;
assert_eq!;
Structs
-
Char16Trie
This struct represents a de-serialized
Char16Triethat was exported from ICU binary data. -
Char16TrieIterator
This struct represents an iterator over a
Char16Trie.
Enums
-
TrieResult
An enum representing the return value from a lookup in
Char16Trie.