Back reference to the parent struct

So I am still learning myself and here are my thoughts:
I think you are right with regular reference types it's not really possible. To do what you want you will have to mutate a structure while keeping the reference to it somewhere else (in your case another structure) and that's a big no no in Rust.
Rust was specifically designed to prevent this type of behavior (yey memory safety, yey no data races)
Rust offers raw pointers, which you can use to do stuff like that, or you can play with Rc, Arc smart pointers.

1 Like