Node

Trait Node 

Source
pub trait Node {
    type DependencyType;

    // Required methods
    fn dependencies(&self) -> &[Self::DependencyType];
    fn matches(&self, dependency: &Self::DependencyType) -> bool;
}
Expand description

Must be implemented by the type you wish to build a dependency graph for. See the README.md for an example

Required Associated Types§

Source

type DependencyType

Encodes a dependency relationship. In a Package Manager dependency graph for intance, this might be a (package name, version) tuple. It might also just be the exact same type as the one that implements the Node trait, in which case Node::matches can be implemented through simple equality.

Required Methods§

Source

fn dependencies(&self) -> &[Self::DependencyType]

Returns a slice of dependencies for this Node

Source

fn matches(&self, dependency: &Self::DependencyType) -> bool

Returns true if the dependency can be met by us.

Implementors§