// Assumes given nodes exist...which is basically guaranteed
Assumes given nodes exist...which is basically guaranteed
Assumes given nodes exist ... which is basically guaranteed
pub fn add_edge(&mut self, start_node: Rc<RefCell<Node<TNode, TEdge>>>, end_node: Rc<RefCell<Node<TNode, TEdge>>>, data: TEdge)
        -> Rc<RefCell<Edge<TEdge, TNode>>>
    {
        let edge_idx = Rc::new(RefCell::new(Edge::new(data, start_node.clone(), end_node.clone())));
        self.edges.push(edge_idx.clone());
        start_node.borrow_mut().succ.push(edge_idx.clone());
        end_node.borrow_mut().pred.push(edge_idx.clone());
        edge_idx
    }
pub fn add_edge ( & mut self , start_node : Rc < RefCell < Node < TNode , TEdge > > > , end_node : Rc < RefCell < Node < TNode , TEdge > > > , data : TEdge ) -> Rc < RefCell < Edge < TEdge , TNode > > > { let edge_idx = Rc :: new ( RefCell :: new ( Edge :: new ( data , start_node . clone ( ) , end_node . clone ( ) ) ) ) ; self . edges . push ( edge_idx . clone ( ) ) ; start_node . borrow_mut ( ) . succ . push ( edge_idx . clone ( ) ) ; end_node . borrow_mut ( ) . pred . push ( edge_idx . clone ( ) ) ; edge_idx }
Assumes given nodes exist...which is basically guaranteed
Assumes given nodes exist ... which is basically guaranteed
&mut self
start_node
Rc<RefCell<Node<TNode, TEdge>>>
end_node
Rc<RefCell<Node<TNode, TEdge>>>
data
TEdge