Debian Codegraph @

debian/missing-sources/zerotrie/src/lib.rs

raw symbols SCIP
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 //! A data structure offering zero-copy storage and retrieval of byte strings, with a focus
6 //! on the efficient storage of ASCII strings. Strings are mapped to `usize` values.
7 //!
8 //! [`ZeroTrie`] does not support mutation because doing so would require recomputing the entire
9 //! data structure. Instead, it supports conversion to and from [`LiteMap`] and [`BTreeMap`].
10 //!
11 //! There are multiple variants of [`ZeroTrie`] optimized for different use cases.
12 //!
13 //! # Examples
14 //!
15 //! ```
16 //! use zerotrie::ZeroTrie;
17 //!
18 //! let data: &[(&str, usize)] = &[("abc", 11), ("xyz", 22), ("axyb", 33)];
19 //!
20 //! let trie: ZeroTrie<Vec<u8>> = data.iter().copied().collect();
21 //!
22 //! assert_eq!(trie.get("axyb"), Some(33));
23 //! assert_eq!(trie.byte_len(), 18);
24 //! ```
25 //!
26 //! # Internal Structure
27 //!
28 //! To read about the internal structure of [`ZeroTrie`], build the docs with private modules:
29 //!
30 //! ```bash
31 //! cargo doc --document-private-items --all-features --no-deps --open
32 //! ```
33 //!
34 //! [`LiteMap`]: litemap::LiteMap
35 //! [`BTreeMap`]: alloc::collections::BTreeMap
36
37 // https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations
38 #![cfg_attr(not(any(test, doc)), no_std)]
39 #![cfg_attr(
40 not(test),
41 deny(
42 clippy::indexing_slicing,
43 clippy::unwrap_used,
44 clippy::expect_used,
45 clippy::panic,
46 clippy::exhaustive_structs,
47 clippy::exhaustive_enums,
48 clippy::trivially_copy_pass_by_ref,
49 missing_debug_implementations,
50 )
51 )]
52 #![warn(missing_docs)]
53
54 #[cfg(feature = "alloc")]
55 extern crate alloc;
56
57 mod builderrust-analyzer cargo zerotrie 0.2.3 builder/;
58 mod byte_phfrust-analyzer cargo zerotrie 0.2.3 byte_phf/;
59 pub mod cursorrust-analyzer cargo zerotrie 0.2.3 cursor/;
60 mod errorrust-analyzer cargo zerotrie 0.2.3 error/;
61 #[macro_use]
62 mod helpersrust-analyzer cargo zerotrie 0.2.3 helpers/;
63 mod optionsrust-analyzer cargo zerotrie 0.2.3 options/;
64 mod readerrust-analyzer cargo zerotrie 0.2.3 reader/;
65 #[cfg(feature = "serde")]
66 mod serde;
67 mod varintrust-analyzer cargo zerotrie 0.2.3 varint/;
68 mod zerotrierust-analyzer cargo zerotrie 0.2.3 zerotrie/;
69
70 pub use craterust-analyzer cargo zerotrie 0.2.3 crate/::zerotrierust-analyzer cargo zerotrie 0.2.3 zerotrie/::ZeroAsciiIgnoreCaseTrierust-analyzer cargo zerotrie 0.2.3 zerotrie/ZeroAsciiIgnoreCaseTrie#;
71 pub use craterust-analyzer cargo zerotrie 0.2.3 crate/::zerotrierust-analyzer cargo zerotrie 0.2.3 zerotrie/::ZeroTrierust-analyzer cargo zerotrie 0.2.3 zerotrie/ZeroTrie#;
72 pub use craterust-analyzer cargo zerotrie 0.2.3 crate/::zerotrierust-analyzer cargo zerotrie 0.2.3 zerotrie/::ZeroTrieExtendedCapacityrust-analyzer cargo zerotrie 0.2.3 zerotrie/ZeroTrieExtendedCapacity#;
73 pub use craterust-analyzer cargo zerotrie 0.2.3 crate/::zerotrierust-analyzer cargo zerotrie 0.2.3 zerotrie/::ZeroTriePerfectHashrust-analyzer cargo zerotrie 0.2.3 zerotrie/ZeroTriePerfectHash#;
74 pub use craterust-analyzer cargo zerotrie 0.2.3 crate/::zerotrierust-analyzer cargo zerotrie 0.2.3 zerotrie/::ZeroTrieSimpleAsciirust-analyzer cargo zerotrie 0.2.3 zerotrie/ZeroTrieSimpleAscii#;
75 pub use errorrust-analyzer cargo zerotrie 0.2.3 error/::ZeroTrieBuildErrorrust-analyzer cargo zerotrie 0.2.3 error/ZeroTrieBuildError#;
76
77 #[cfg(feature = "alloc")]
78 pub use craterust-analyzer cargo zerotrie 0.2.3 crate/::zerotrierust-analyzer cargo zerotrie 0.2.3 zerotrie/::ZeroTrieStringIterator;
79 #[cfg(feature = "alloc")]
80 pub use readerrust-analyzer cargo zerotrie 0.2.3 reader/::ZeroTrieIterator;
81
82 #[doc(hidden)]
83 pub mod _internalrust-analyzer cargo zerotrie 0.2.3 _internal/ {
84 pub use craterust-analyzer cargo zerotrie 0.2.3 crate/::byte_phfrust-analyzer cargo zerotrie 0.2.3 byte_phf/::f1rust-analyzer cargo zerotrie 0.2.3 byte_phf/f1().;
85 pub use craterust-analyzer cargo zerotrie 0.2.3 crate/::byte_phfrust-analyzer cargo zerotrie 0.2.3 byte_phf/::f2rust-analyzer cargo zerotrie 0.2.3 byte_phf/f2().;
86 pub use craterust-analyzer cargo zerotrie 0.2.3 crate/::byte_phfrust-analyzer cargo zerotrie 0.2.3 byte_phf/::PerfectByteHashMaprust-analyzer cargo zerotrie 0.2.3 byte_phf/PerfectByteHashMap#;
87 }