pub fn push_child(node: &NodePtr<T>, data: T) -> NodePtr<T> {
        let new_node = Rc::from(RefCell::from(Tree {
            data,
            parent: Some(Rc::downgrade(node)),
            siblings: vec![],
        }));
        node.borrow_mut().siblings.push(new_node.clone());
        new_node
    }
/// Add subnode to current node with specified value.
///
/// Nodes are added to the end of node stack for current node.
///
/// # Examples
///
/// ```
/// let root = Tree::new(0);
///
/// let one = Tree::push_child(&root, 1);
///
/// assert_eq!(root.borrow().to_string(), "(0 (1))");
/// ```
///
Add subnode to current node with specified value.
Nodes are added to the end of node stack for current node.
Add subnode to current node with specified value . Nodes are added to the end of node stack for current node .
pub fn push_child(node: &NodePtr<T>, data: T) -> NodePtr<T> {
        let new_node = Rc::from(RefCell::from(Tree {
            data,
            parent: Some(Rc::downgrade(node)),
            siblings: vec![],
        }));
        node.borrow_mut().siblings.push(new_node.clone());
        new_node
    }
pub fn push_child ( node : & NodePtr < T > , data : T ) -> NodePtr < T > { let new_node = Rc :: from ( RefCell :: from ( Tree { data , parent : Some ( Rc :: downgrade ( node ) ) , siblings : vec ! [ ] , } ) ) ; node . borrow_mut ( ) . siblings . push ( new_node . clone ( ) ) ; new_node }
Add subnode to current node with specified value.
Add subnode to current node with specified value .
node
&NodePtr<T>
data
T
examples


let one = Tree::push_child(&root, 1).


let one = Tree :: push_child ( &root 1 ) .