prefix-trie
Prefix trie (tree) datastructure (both a set and a map) that provides exact and longest-prefix matches.
0.10.1
13M downloads/mo
#2731 most downloaded on crates.io
tiborschneider/prefix-trie
What this package is like to depend on
Last release 1 months ago
24 Jul 2026
Release timing varies
gaps range from 1 weeks to 9 months
Some releases are documented
notes for 8 of 26 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
26 releases · first in 2022
10 releases in the last 12 months
see the full history below
Release timeline
26 releases · Dec 2022 to Jul 2026Releases
latest 26-
0.10.124 Jul 2026Nothing published for this version
-
0.10.024 Jul 2026Release notes
Open source →What's new
rkyvzero-copy (de)serializationThis release adds a new
rkyvfeature flag, bringing zero-copy serialization support toPrefixMap,PrefixSet, andJointPrefixMap/JointPrefixSet. The archived types implement the sameTrieViewinterface as their live counterparts, so you can look up, iterate, and compute covering/LPM/SPM queries directly on the archived (mmap'ed) representation without deserializing.get,get_key_value,contains,get_lpm,get_spm,is_covered,is_covered_in_aggregate,address_count,children,iter/iter_from, and cover iterators are all available on the archived variants.ArchivedTrieReftype that implementsTrieView, enabling integration with concrete (non-archive) types. The new functions onTrieViewsimplify this process.- See the new module-level examples for how to serialize, mmap, and query an archived trie.
Others
- New
FilterViewto filter a view by a predicate closure. - New
ClonedViewandCopiedViewadapters. - New
MapViewcombinator forTrieView. is_coveredandis_covered_in_aggregateadded to the core map/set API.
Fixes
- Fixed a repositioning bug in
TrieViewthat could cause UB. - Fixed
Defaultimplementations onJointiterators (were previously inconsistent/incorrect). - Removed
stepandnavigate_tofrom the publicTrieViewinterface (internal-only).
Other
- Raised rust minimal supported version to 1.81.0
Full Changelog: v0.9.4...v0.10.0
-
0.9.419 Jul 2026Release notes
Open source →What's Changed
- Feature: Add
address_counttoPrefixMap,PrefixSet, andJointPrefixMapby @digizeph in #31 - Example: add streaming export/import example by @digizeph in #32
- Fix:
remove_childrennow properly cleans up the tree.
New Contributors
Full Changelog: v0.9.3...v0.9.4
- Feature: Add
-
0.9.305 Jul 2026Release notes
Open source →New Aggregation Algorithms
PrefixMap::aggregate_consistentandPrefixSet::aggregate_consistentremove covering prefixes (that are covered with the same value). Anyget_lpmcall (for any prefix) will still return the same value (with a potential different result).PrefixSet::aggregateremoves covering prefixes and merges adjacent ones. In contrast toaggregate_consistent, callingget_lpmon addresses (e.g., /32 on IPv4) still yields the same value. However, for prefixes, that is not the case.PrefixMap::aggregate,PrefixMap::aggregate_fill, andPrefixMap::aggregate_fill_defaultare implementation of the ORTC algorithm by R. P. Draves, C. King, S. Venkatachary, and B. D. Zill. Thefillvariants are allowed to add new prefixes (e.g., 0.0.0.0/0) with the provided default value, while the non-fillvariant does ensures that uncovered prefixes remain uncovered.
Bug Fixes
- Add missing
joint::map::OccupiedEntry::into_mutfunction
Full Changelog: v0.9.1...v0.9.3
-
0.9.218 May 2026Nothing published for this version
-
0.9.118 May 2026Release notes
Open source →What's Changed
- Add
iter_fromfunction to enable paginated output. - Implement equality on views (
eq_keysandeq_by) - Add
Eqimplementation for PrefixMap - Slightly reduce memory footprint (increment number of tiers in allocator from 6 to 7; [1, 2, 4, 8, 16, 24, 32])
- Benchmark using mutations from RIPE RIS by @ties in #28
- Add IPv6 test cases and data by @ties in #30
Bug Fixes
- Drop values only when needed.
- Fix memory corruption bug when calling
remove_childrenin deep trees. - Fix overflow for obtaining sub-views of maximum prefix length views.
- Fix mask computation on 32-bit targets.
- Fix undefined behavior when drop panics in
remove_children.
New Contributors
Full Changelog: v0.9.0...v0.9.1
- Add
-
0.9.014 May 2026Release notes
Open source →What's Changed
- Migrate to the TreeBitMap implementation by W. Eatherton, Z. Dittia, G. Varghes.
- ~4x less memory consumption and ~8x performance improvement over v0.8.4, measured on all IPv4 prefixes advertised at AMS-IX.
- Flexible simultaneous tree traversal algorithms that can be combined arbitrarily.
Migration Notes
- Prefixes are reconstructed from the tree location and no longer stored.
Consequently, information in the host part of an address is no longer maintained.
Additionally, the function yields prefixes by value instead of by reference.
If you wish to store the host-bits as well, consider constructing a typePrefixMap<P, (P, T)>. - Mutable views of the tree can no longer modify the tree structure (to maintain memory safety).
This is because one can construct two mutable views pointing to branches within the same multi-bit node. - Thanks to bitmaps, set operations can now be chained (as we can define a common interface for them to return their bitmaps).J
Full Changelog: v0.8.4...v0.9.0
-
0.8.411 May 2026Release notes
Open source →What's Changed
- Raise minimum dependency versions by @divergentdave in #25
New Contributors
- @divergentdave made their first contribution in #25
Full Changelog: v0.8.3...v0.8.4
-
0.8.304 May 2026Release notes
Open source →What's Changed
- Fix memory leak during parent node collapse (Closes #23) by @nawed2010 in #24
New Contributors
- @nawed2010 made their first contribution in #24
Full Changelog: v0.8.2...v0.8.3
-
0.8.222 Mar 2026 -
0.8.119 Jun 2025Nothing published for this version
-
0.8.018 Jun 2025Nothing published for this version
-
0.7.004 Apr 2025Nothing published for this version
-
0.6.026 Jan 2025Nothing published for this version
-
0.5.115 Sep 2024Nothing published for this version
-
0.5.028 Aug 2024Nothing published for this version
-
0.4.203 Jul 2024Nothing published for this version
-
0.4.121 May 2024Nothing published for this version
-
0.4.014 May 2024Nothing published for this version
-
0.3.010 Mar 2024Nothing published for this version
-
0.2.511 Jan 2024Nothing published for this version
-
0.2.409 Jan 2023Nothing published for this version
-
0.2.306 Jan 2023Nothing published for this version
-
0.2.204 Jan 2023Nothing published for this version
-
0.2.103 Jan 2023Nothing published for this version
-
0.2.030 Dec 2022Nothing published for this version