Any advice on building safe self-referential structs

⚓ Rust    📅 2025-12-17    👤 surdeus    👁️ 8      

surdeus

Warning

This post was published 50 days ago. The information described in this article may have changed.

Currently 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

Read full topic

🏷️ Rust_feed