5 releases

new 0.2.0 Nov 23, 2024
0.1.3 May 28, 2024
0.1.2 Nov 16, 2023
0.1.1 Oct 3, 2023
0.1.0 Sep 23, 2023

#325 in Internationalization (i18n)

Download history 24045/week @ 2024-08-03 25426/week @ 2024-08-10 24930/week @ 2024-08-17 27764/week @ 2024-08-24 25559/week @ 2024-08-31 26607/week @ 2024-09-07 27340/week @ 2024-09-14 63955/week @ 2024-09-21 62384/week @ 2024-09-28 64175/week @ 2024-10-05 40621/week @ 2024-10-12 37779/week @ 2024-10-19 30825/week @ 2024-10-26 40641/week @ 2024-11-02 38670/week @ 2024-11-09 29638/week @ 2024-11-16

145,684 downloads per month
Used in 93 crates (6 directly)

Unicode-3.0

415KB
7K SLoC

zerotrie crates.io

A data structure offering zero-copy storage and retrieval of byte strings, with a focus on the efficient storage of ASCII strings. Strings are mapped to usize values.

ZeroTrie does not support mutation because doing so would require recomputing the entire data structure. Instead, it supports conversion to and from LiteMap and BTreeMap.

There are multiple variants of ZeroTrie optimized for different use cases.

Examples

use zerotrie::ZeroTrie;

let data: &[(&str, usize)] = &[("abc", 11), ("xyz", 22), ("axyb", 33)];

let trie: ZeroTrie<Vec<u8>> = data.iter().copied().collect();

assert_eq!(trie.get("axyb"), Some(33));
assert_eq!(trie.byte_len(), 18);

Internal Structure

To read about the internal structure of ZeroTrie, build the docs with private modules:

cargo doc --document-private-items --all-features --no-deps --open

More Information

For more information on development, authorship, contributing etc. please visit ICU4X home page.

Dependencies

~235–760KB
~18K SLoC