Any advice on building safe self-referential structs
⚓ Rust 📅 2025-12-17 👤 surdeus 👁️ 2Currently building a lazy graph iterator.
type Key = Vec<usize>;
type Value = (bool, HashMap<Rule,Key> ); // valid rules -> next states
struct LazyDfaa<'a>{
reference: &'a NFA,
cache : HashMap<Key, Value>,
step : Option <Key>
}
I'm aware of the "indexing method"
But since this is small project (nothing professionnal), i was wondering more efficient ways (safe and unsafe) to do it.
Advice, documentation, guidance is welcomed
1 post - 1 participant
🏷️ Rust_feed