Set the parent of a position.
(&mut self, child: Position<NodeId>, parent: Position<NodeId>)
| 568 | |
| 569 | /// Set the parent of a position. |
| 570 | pub fn set_parent(&mut self, child: Position<NodeId>, parent: Position<NodeId>) { |
| 571 | self.parents.insert(child, parent); |
| 572 | self.children.entry(parent).or_default().push(child); |
| 573 | } |
| 574 | |
| 575 | /// Get the parent of a position. |
| 576 | pub fn get_parent(&self, child: &Position<NodeId>) -> Option<Position<NodeId>> { |