In this project I'm working on I have one struct that holds several other smaller structs. All the child structs need a reference to the one common resource. I was thinking the best way to do this is to make this shared resource a member of the parent struct and pass a reference to all the children, but now I don't know exactly how to do this rust. I've written a smaller example gist to show what I'm thinking. libs.rs · GitHub
In the example Outside is the parent struct, ToRef is what I want to be the shared resource and Inside is the child. What I really want to do is hand a reference to Outside::b to inside but I don't know if that's possible. Any tips?