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

#620 in Internationalization (i18n)

Download history 2686660/week @ 2025-10-22 2997268/week @ 2025-10-29 3126674/week @ 2025-11-05 3121015/week @ 2025-11-12 3380601/week @ 2025-11-19 2764080/week @ 2025-11-26 3458006/week @ 2025-12-03 3643628/week @ 2025-12-10 3298318/week @ 2025-12-17 2001115/week @ 2025-12-24 2539390/week @ 2025-12-31 3841009/week @ 2026-01-07 3942213/week @ 2026-01-14 4336542/week @ 2026-01-21 4369127/week @ 2026-01-28 4726888/week @ 2026-02-04

18,146,467 downloads per month
Used in 45,691 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

~135–610KB
~14K SLoC