Skip to main content

Crate kermit_iters

Crate kermit_iters 

Source
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§

FxHashStrategy
FxHash via the rustc-hash crate. Fast non-cryptographic hash; typically ~10× faster per call than SipHash on small integer keys.
SipHashStrategy
SipHash via the standard library’s DefaultHasher. The default for HashTrie<H> — preserves pre-standard behavior.
TrieIteratorWrapper
Adapts a TrieIterator into a standard Iterator<Item = Vec<usize>>.

Traits§

BuildMode
Trait for construction-time build modes (e.g., serial vs parallel, radix-partitioned vs not).
ConfigOption
Trait for runtime configuration options (boolean/enum flags toggled without monomorphization).
HasOptimizationAxes
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 from LayoutOption::NAME, ConfigOption::axes, and BuildMode::axis_value under the correct key prefixes.
HashStrategy
A hash function for usize keys, selected at compile time.
HashTrieIterable
Marker for types that expose a HashTrieIterator.
HashTrieIterator
Iterator over a hash trie. Navigates nested hash tables level by level.
JoinIterable
Marker trait for types that can participate in a join.
LayoutOption
Marker trait for a compile-time layout option (e.g., pointer encoding, hash strategy). Implementing types are typically zero-sized.
LinearIterable
The LinearIterable trait is used to specify types that can be iterated through the LinearIterator interface, and as such used in algorithms that require such an iterator.
LinearIterator
The LinearIterator trait, designed for iterators that traverse a linear structure.
TrieIterable
The TrieIterable trait is used to specify types that can be iterated through the TrieIterable interface, and as such used in algorithms that require such an iterator.
TrieIterator
The TrieIterator trait, designed for iterators that traverse a trie-based structure.

Type Aliases§

Key
Canonical key type used throughout the library.