Radix Immutable
This is a Radix Trie implementation in Rust that focuses on immutability and efficient prefix operations. This started as a fork of the original radix_trie crate and was rewritten with the assistance of LLM tools.
Features
- Immutable API with structural sharing for efficient versioning
- Fast prefix comparison between trees
- Compressed nodes with common key prefixes stored only once
- Efficient thread-safe caching of structural hashes and subtree sizes using OnceCell
- Structural hashing for efficient subtree comparison (~43ns per lookup)
- Key generic - supports any type that can be converted to bytes
- Prefix views for efficiently querying and comparing subtries
- Safe - no unsafe code
Documentation
https://docs.rs/radix-immutable/
Usage
Available on Crates.io as [radix-immutable][radix-immutable].
Add radix-immutable to the dependencies section of your Cargo.toml:
# Basic usage
= "0.1"
Original radix_trie Contributors
- Allan Simon (@allan-simon)
- Andrew Smith (@andrewcsmith)
- Arthur Carcano (@NougatRillettes)
- Devin Ragotzy (@DevinR528)
- @hanabi1224
- Jakob Dalsgaard (@jakobdalsgaard)
- Michael Sproul (@michaelsproul)
- Robin Lambertz (@roblabla)
- Sergey (@Albibek)
- Stuart Hinson (@stuarth)
- Vinzent Steinberg (@vks)
License
MIT License. Copyright © Micah Fitch, Michael Sproul and contributors 2015-present.