2 ms·
Could you keep parent reference in Option<Rc<Node>> ?
by scotty79 5y ago
Could you keep parent reference in Option<Rc<Node>> ?
- eliben 5y ago`Rc` implies ownership, albeit shared one. So if a heap location is held by `Rc`, all reference to it should be either `Rc` or `Weak`. You can't have an `Rc` and a `Box` for the same data, IIUC. A `Box` is unaware of `Rc` and will drop its data when dropped itself.