Skip to main content

Crate tiny_trie

Crate tiny_trie 

Source
Expand description

Compact arena-based radix tries with SIMD-accelerated lookup.

This crate provides several trie data structures optimized for different use cases:

  • NibbleTrie — 16-way radix trie (nibble-indexed), the flagship implementation
  • NibTrie — 4-way radix trie (2-bit indexed)
  • BitTrie — Binary radix trie (bit-indexed)
  • DynTrie — Auto-promoting wrapper around NibbleTrie (requires the dyn feature)
  • FixedLenNibbleTrie — NibbleTrie variant for fixed-length keys (requires the fixed-len feature)

All tries use arena-based node allocation for cache-friendly memory layout and SIMD-accelerated child lookup where applicable.

Each tree exposes a seekable cursor over (&[u8], &T) pairs via its iter() / iter_last() methods (nibble_trie::Cursor, nib_trie::Cursor, bit_trie::Cursor).

Re-exports§

pub use nibble_trie::NibbleTrie;
pub use nibble_trie::TrieIndex;
pub use nib_trie::NibTrie;
pub use bit_trie::BitTrie;
pub use dyn_trie::DynTrie;
pub use fixed_len_nibble_trie::FixedLenNibbleTrie;

Modules§

bit_trie
Bit Trie — a binary radix trie indexed by individual key bits.
dyn_trie
Dynamic NibbleTrie — starts with compact u8 arena indices and promotes to wider types (u16 → u32 → u64) as the trie grows.
fixed_len_nibble_trie
Fixed-Length Nibble Trie — a fixed-fanout radix trie with fixed-length key slots.
nib_trie
Nib Trie — a fixed-fanout radix trie indexed by 2-bit words (nibs).
nibble_trie
Nibble Trie — a fixed-fanout radix trie indexed by nibbles (half-bytes).

Traits§

ByteKey
A key type that can be converted to and from a byte slice while preserving ordering.
TrieKey
A key type that can be stored in a trie.