[][src]Struct solvent::DepGraph

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).

Implementations

impl<T: Eq> DepGraph<T>[src]

pub fn new() -> DepGraph<T>[src]

Create an empty DepGraph.

pub 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.

pub 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.

pub 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.

pub 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.

pub 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.

pub fn dependencies_of<'a>(
    &'a self,
    target: &T
) -> Result<DepGraphIterator<'a, T>, SolventError>
[src]

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

Trait Implementations

impl<T: Clone + Eq> Clone for DepGraph<T>[src]

impl<T: Debug + Eq> Debug for DepGraph<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for DepGraph<T> where
    T: RefUnwindSafe

impl<T> Send for DepGraph<T> where
    T: Send

impl<T> Sync for DepGraph<T> where
    T: Sync

impl<T> Unpin for DepGraph<T> where
    T: Unpin

impl<T> UnwindSafe for DepGraph<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.