Expand description
Procedural macros for the Kermit workspace.
Provides #[derive(IntoTrieIter)] to automatically implement
IntoIterator for trie-iterator types, wrapping them in
TrieIteratorWrapper so that for tuple in iter { ... } yields
Vec<usize> tuples directly.
§Example
ⓘ
use kermit_iters::{LinearIterator, TrieIterator, TrieIteratorWrapper};
use kermit_derive::IntoTrieIter;
#[derive(IntoTrieIter)]
struct MyTrieIter<'a> {
// ... fields ...
}
impl LinearIterator for MyTrieIter<'_> { /* ... */ }
impl TrieIterator for MyTrieIter<'_> { /* ... */ }
// The derive generates:
// impl<'a> IntoIterator for MyTrieIter<'a> {
// type Item = Vec<usize>;
// type IntoIter = TrieIteratorWrapper<Self>;
// fn into_iter(self) -> Self::IntoIter { TrieIteratorWrapper::new(self) }
// }See kermit-derive/tests/derive_into_trie_iter.rs for a runnable example
with a minimal mock trie, and kermit-ds for two production uses
(TreeTrieIter, ColumnTrieIter).
Derive Macros§
- Into
Trie Iter - Derives
IntoIteratorfor a trie-iterator struct.