Hi there. I am currently trying to build a data structure that has two sets of unique values and a third set of a reference to each one and one extra value.
What i've tried so far is using three hashbrown::HashSet's like so
struct MyDatastructure {
value1: HashSet<Type1>
value2: HashSet<Type2>
value3: HashSet<(Type3, &Type1, &Type2)>
}
The important point is the uniqueness of every element in value1 or value2 and the combination of two such values and a third value.
I've come to notice that this does not work, as when I am inserting into value1 or value2 the HashSet could outgrow it's capacity and then relocate to somewhere else, and the reference would be no longer valid. Is there some nice way to do such data structures?
For any responses or suggestions I would be very grateful.
Thank you
Justus Flügel