Debian Codegraph @

debian/rust-vendor/icu_collections/src/codepointtrie/mod.rs

raw
1 // This file is part of ICU4X. For terms of use, please see the file
2 // called LICENSE at the top level of the ICU4X source tree
3 // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5 //! This module provides a data structure for an time-efficient lookup of values
6 //! associated to code points.
7 //!
8 //! It is an implementation of the existing [ICU4C UCPTrie](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucptrie_8h.html)
9 //! / [ICU4J CodePointTrie](https://unicode-org.github.io/icu-docs/apidoc/dev/icu4j/) API.
10 //!
11 //! # Architecture
12 //!
13 //! ICU4X [`CodePointTrie`] is designed to provide a read-only view of [`CodePointTrie`] data that is exported
14 //! from ICU4C. Detailed information about the design of the data structure can be found in the documentation
15 //! for the [`CodePointTrie`] struct.
16 //!
17 //! # Examples
18 //!
19 //! ## Querying a `CodePointTrie`
20 //!
21 //! ```
22 //! use icu::collections::codepointtrie::planes;
23 //! let trie = planes::get_planes_trie();
24 //!
25 //! assert_eq!(0, trie.get32(0x41)); // 'A' as u32
26 //! assert_eq!(0, trie.get32(0x13E0)); // 'Ꮰ' as u32
27 //! assert_eq!(1, trie.get32(0x10044)); // '𐁄' as u32
28 //! ```
29 //!
30 //! [`ICU4X`]: ../icu/index.html
31
32 mod cptrie;
33 mod error;
34 mod impl_const;
35 pub mod planes;
36
37 #[cfg(feature = "serde")]
38 pub mod toml;
39
40 #[cfg(feature = "serde")]
41 mod serde;
42
43 pub use cptrie::CodePointMapRange;
44 pub use cptrie::CodePointMapRangeIterator;
45 pub use cptrie::CodePointTrie;
46 pub use cptrie::CodePointTrieHeader;
47 pub use cptrie::FastCodePointTrie;
48 pub use cptrie::SmallCodePointTrie;
49 pub use cptrie::TrieType;
50 pub use cptrie::TrieValue;
51 pub use cptrie::Typed;
52 pub use cptrie::TypedCodePointTrie;
53 pub use error::Error as CodePointTrieError;