Hi, so I'm having a trouble here depending on a specific order in a struct and I'd really like to get rid of that.
I'm having a struct which is invoking two other structs. However when I was implementing the Drop trait on all three of them I thought that I would need a specific order of going out of scope. However using the std::mem::drop didn't really help in that case since we need to move self and the drop method from the Drop trait provides us with mutable reference only as expected.
So if I have three structs called A, B, C what I want is when A starts to go out of scope to drop C first and then B before we finally drop A. What I did was switching places in the struct which caused a new order of dropping the objects, but as mentioned I'd like to be able to control that somehow and not rely on ordering items in a struct.
That's the stupid way of explaining what I'm trying to achieve: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=dcb33ce71b55ed17d0eb70988cacb651