I need to implement a tree-like data structure, in which each node possibly has 2 children, and each child node has a reference to its parent (except root node). Here is a sketch:
strcut Node {
parent: Option< ??? >,
child_1: Option<Box<Node>>,
child_2: Option<Box<Node>>
}
As you can see I don't know what type should a parent field be. Can it be just a plain unsafe pointer? What is the proper way of implementing it?