Populate the [`DocumentNode::path`], which stores the location of the document node to allow for matching the resulting proto nodes to the document node for the purposes of typing and finding monitor nodes.
(&mut self, prefix: &[NodeId])
| 745 | |
| 746 | /// Populate the [`DocumentNode::path`], which stores the location of the document node to allow for matching the resulting proto nodes to the document node for the purposes of typing and finding monitor nodes. |
| 747 | pub fn generate_node_paths(&mut self, prefix: &[NodeId]) { |
| 748 | for (node_id, node) in &mut self.nodes { |
| 749 | let mut new_path = prefix.to_vec(); |
| 750 | if !self.generated { |
| 751 | new_path.push(*node_id); |
| 752 | } |
| 753 | if let DocumentNodeImplementation::Network(network) = &mut node.implementation { |
| 754 | network.generate_node_paths(new_path.as_slice()); |
| 755 | } |
| 756 | if node.original_location.path.is_some() { |
| 757 | log::warn!("Attempting to overwrite node path"); |
| 758 | } else { |
| 759 | node.original_location.path = Some(new_path); |
| 760 | node.original_location.inputs_exposed = node.inputs.iter().map(|input| input.is_exposed()).collect(); |
| 761 | node.original_location.dependants = (0..node.implementation.output_count()).map(|_| Vec::new()).collect(); |
| 762 | } |
| 763 | } |
| 764 | } |
| 765 | |
| 766 | pub fn populate_dependants(&mut self) { |
| 767 | let mut dep_changes = Vec::new(); |
no test coverage detected