Trait dependency_graph::Node [−][src]
pub trait Node {
type DependencyType;
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
Associated Types
type DependencyType
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
fn dependencies(&self) -> &[Self::DependencyType]
fn dependencies(&self) -> &[Self::DependencyType]
Returns a slice of dependencies for this Node
fn matches(&self, dependency: &Self::DependencyType) -> bool
fn matches(&self, dependency: &Self::DependencyType) -> bool
Returns true if the dependency can be met by us.