Struct solvent::DepGraph
[−]
[src]
pub struct DepGraph<T: Eq> { /* fields omitted */ }
This is the dependency graph. The type T
is intended to be a small type, or a
reference to a larger type that implements Eq
(you will need to supply the type
and vectors of the type to functions).
Methods
impl<T: Eq> DepGraph<T>
[src]
fn new() -> DepGraph<T>
[src]
Create an empty DepGraph.
fn register_nodes(&mut self, nodes: Vec<T>)
[src]
Register nodes in the graph. The nodes
are added to any existing nodes,
after checking to avoid duplicates.
fn register_node(&mut self, node: T)
[src]
Register a node in the graph. The node
is added to any existing nodes,
after checking to avoid duplicates.
fn register_dependency(&mut self, node: T, depends_on: T)
[src]
Add a dependency to a DepGraph. The node does not need to pre-exist, nor does the dependency node. If the node does pre-exist, the depends_on will be added to its existing dependency list. Otherwise it will be created.
fn register_dependencies(&mut self, node: T, depends_on: Vec<T>)
[src]
Add multiple dependencies of one node to a DepGraph. The node does not need to pre-exist, nor does the dependency node. If the node does pre-exist, the depends_on will be added to its existing dependency list. Otherwise it will be created.
fn mark_as_satisfied(&mut self, nodes: &[T]) -> Result<(), SolventError>
[src]
This marks a node as satisfied. Iterators will not output such nodes. Nodes must exist.
fn dependencies_of<'a>(
&'a self,
target: &T
) -> Result<DepGraphIterator<'a, T>, SolventError>
[src]
&'a self,
target: &T
) -> Result<DepGraphIterator<'a, T>, SolventError>
Get an iterator to iterate through the dependencies of the target node. Target node must exist.