Expand description
Core iterator traits for Kermit’s relational algebra engine.
This crate defines the trait hierarchy that all data structures and
algorithms build upon: LinearIterator for flat sorted sequences and
TrieIterator for hierarchical trie traversal. TrieIteratorWrapper
adapts any TrieIterator into a standard Iterator<Item = Vec<usize>> that
yields complete tuples via depth-first traversal.
All keys are usize (dictionary-encoded); see Key. The marker trait
JoinIterable unifies data structures that may participate in joins.
§Example
Vec<usize> ships with a LinearIterable implementation, useful as a
minimal example of the trait:
use kermit_iters::{LinearIterable, LinearIterator};
let data = vec![1_usize, 3, 5, 7];
let mut iter = data.linear_iter();
// Iterators start positioned *before* the first key.
assert_eq!(iter.next(), Some(1));
// `seek` advances to the least upper bound of the given key.
assert!(iter.seek(4));
assert_eq!(iter.key(), Some(5));
assert_eq!(iter.next(), Some(7));
assert_eq!(iter.next(), None);
assert!(iter.at_end());Structs§
- FxHash
Strategy - FxHash via the
rustc-hashcrate. Fast non-cryptographic hash; typically ~10× faster per call than SipHash on small integer keys. - SipHash
Strategy - SipHash via the standard library’s
DefaultHasher. The default forHashTrie<H>— preserves pre-standard behavior. - Trie
Iterator Wrapper - Adapts a
TrieIteratorinto a standardIterator<Item = Vec<usize>>.
Traits§
- Build
Mode - Trait for construction-time build modes (e.g., serial vs parallel, radix-partitioned vs not).
- Config
Option - Trait for runtime configuration options (boolean/enum flags toggled without monomorphization).
- HasOptimization
Axes - Umbrella trait consumed by the bench reporter to populate optimization
axes in
BenchReport.axes. A DS or algorithm that adopts the standard implements this; the implementation typically composes results fromLayoutOption::NAME,ConfigOption::axes, andBuildMode::axis_valueunder the correct key prefixes. - Hash
Strategy - A hash function for
usizekeys, selected at compile time. - Hash
Trie Iterable - Marker for types that expose a
HashTrieIterator. - Hash
Trie Iterator - Iterator over a hash trie. Navigates nested hash tables level by level.
- Join
Iterable - Marker trait for types that can participate in a join.
- Layout
Option - Marker trait for a compile-time layout option (e.g., pointer encoding, hash strategy). Implementing types are typically zero-sized.
- Linear
Iterable - The
LinearIterabletrait is used to specify types that can be iterated through theLinearIteratorinterface, and as such used in algorithms that require such an iterator. - Linear
Iterator - The
LinearIteratortrait, designed for iterators that traverse a linear structure. - Trie
Iterable - The
TrieIterabletrait is used to specify types that can be iterated through theTrieIterableinterface, and as such used in algorithms that require such an iterator. - Trie
Iterator - The
TrieIteratortrait, designed for iterators that traverse a trie-based structure.
Type Aliases§
- Key
- Canonical key type used throughout the library.