8 releases

0.2.3 Oct 28, 2025
0.2.2 May 7, 2025
0.2.1 Feb 26, 2025
0.2.0 Nov 23, 2024
0.1.0 Sep 23, 2023

#611 in Internationalization (i18n)

Download history 2103634/week @ 2025-08-19 5089841/week @ 2025-08-26 2472931/week @ 2025-09-02 2296694/week @ 2025-09-09 2317073/week @ 2025-09-16 2391432/week @ 2025-09-23 2434154/week @ 2025-09-30 2410542/week @ 2025-10-07 2524428/week @ 2025-10-14 2638801/week @ 2025-10-21 2991061/week @ 2025-10-28 3163459/week @ 2025-11-04 3045862/week @ 2025-11-11 3372105/week @ 2025-11-18 2762651/week @ 2025-11-25 2782874/week @ 2025-12-02

12,456,181 downloads per month
Used in 40,862 crates (17 directly)

Unicode-3.0

395KB
6.5K 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

~150–640KB
~15K SLoC