Struct solvent::DepGraph [] [src]

pub struct DepGraph<E: Eq + Copy + Hash> {
    pub dependencies: HashMap<E, HashSet<E>>,
    pub satisfied: HashSet<E>,
}

This is the dependency graph

Fields

dependencies: HashMap<E, HashSet<E>>

List of dependencies. The first Element depends on the set of additional Elements.

satisfied: HashSet<E>

The set of Elements already satisfied.

Methods

impl<E: Eq + Copy + Hash> DepGraph<E>
[src]

fn new() -> DepGraph<E>

Create an empty DepGraph.

fn register_dependency(&mut self, node: E, depends_on: E)

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(&mut self, node: E, depends_on: &[E])

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(&mut self, nodes: &[E])

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

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

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

Trait Implementations

impl<E: Clone + Eq + Copy + Hash> Clone for DepGraph<E>
[src]

fn clone(&self) -> DepGraph<E>

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

impl<E: Debug + Eq + Copy + Hash> Debug for DepGraph<E>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.