Struct solvent::DepGraph [] [src]

pub struct DepGraph {
    pub dependencies: HashMap<StringHashSet<String>>,
    pub satisfied: HashSet<String>,
}

This is the dependency graph.

Fields

dependencies: HashMap<StringHashSet<String>>

List of dependencies. Key is the element, values are the other elements that the key element depends upon.

satisfied: HashSet<String>

Nodes already satisfied. dependencies_of() will prune dependency searches at these nodes, and not output nodes registered here.

Methods

impl DepGraph
[src]

fn new() -> DepGraph

Create an empty DepGraph.

fn register_dependency<'a>(&mut self, node: &'a str, depends_on: &'a str)

Add a dependency to a DepGraph. The node does not need to pre-exist, nor do the dependency nodes. But if the node does pre-exist, the depends_on will be added to its existing dependency list.

fn register_dependencies<'a>(&mut self, node: &'a str, depends_on: &'a [&'a str])

Add multiple dependencies of one node to a DepGraph. The node does not need to pre-exist, nor do the dependency elements. But if the node does pre-exist, the depends_on will be added to its existing dependency list.

fn mark_as_satisfied<'a>(&mut self, nodes: &'a [&'a str])

This marks a node as satisfied. Iterators will not output such nodes.

fn dependencies_of<'a>(&'a self, target: &str) -> DepGraphIterator<'a>

Get an iterator to iterate through the dependencies of the target node.

Trait Implementations

impl Clone for DepGraph
[src]

fn clone(&self) -> DepGraph

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more