Struct uvm_install_graph::InstallGraph
source · pub struct InstallGraph<'a> { /* private fields */ }
Expand description
A simple directed acyclic graph representation of a unity version and it’s modules. This graph allows the traversal of to be installed modules in a topological order. It is also possible to query submodule and or dependencies for a given module.
Implementations§
source§impl<'a> InstallGraph<'a>
impl<'a> InstallGraph<'a>
sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
The total number of nodes in the Dag.
pub fn keep(&mut self, modules: &HashSet<Component>)
sourcepub fn from(manifest: &'a Manifest<'a>) -> Self
pub fn from(manifest: &'a Manifest<'a>) -> Self
Builds a Dag representation of the given Manifest.
sourcepub fn topo(&self) -> Topo<NodeIndex, FixedBitSet>
pub fn topo(&self) -> Topo<NodeIndex, FixedBitSet>
Creates a Topo
traversal struct from the current graph to walk the graph in topological order.
pub fn version(&self) -> &Version
pub fn manifest(&self) -> &Manifest<'_>
sourcepub fn mark_all(&mut self, install_status: InstallStatus)
pub fn mark_all(&mut self, install_status: InstallStatus)
Mark all nodes with the given InstallStatus
.
sourcepub fn mark_all_missing(&mut self)
pub fn mark_all_missing(&mut self)
Mark all nodes as InstallStatus::Missing
.
sourcepub fn mark_installed(&mut self, modules: &HashSet<Component>)
pub fn mark_installed(&mut self, modules: &HashSet<Component>)
Mark all nodes contained in modules
as InstallStatus::Installed
.
If the node is not found in modules
the node gets marked as InstallStatus::Missing
.
sourcepub fn component(&self, node: NodeIndex) -> Option<&Component>
pub fn component(&self, node: NodeIndex) -> Option<&Component>
Returns the component for the given node index.
pub fn install_status(&self, node: NodeIndex) -> Option<&InstallStatus>
pub fn get_node_id(&self, component: Component) -> Option<NodeIndex>
pub fn depth(&self, node: NodeIndex) -> usize
sourcepub fn get_dependend_modules(
&self,
node: NodeIndex
) -> Vec<((Component, InstallStatus), NodeIndex)>
pub fn get_dependend_modules( &self, node: NodeIndex ) -> Vec<((Component, InstallStatus), NodeIndex)>
Returns a Vec with all depended modules for the given node.
sourcepub fn get_sub_modules(
&self,
node: NodeIndex
) -> Vec<((Component, InstallStatus), NodeIndex)>
pub fn get_sub_modules( &self, node: NodeIndex ) -> Vec<((Component, InstallStatus), NodeIndex)>
Returns a Vec with all submodules for the given node.