pub trait BasicSourceControlGraph: Debug {
type Node: Clone + Debug + Hash + Eq + 'static;
type Error: Debug + Error + 'static;
// Required methods
fn ancestors(
&self,
node: Self::Node,
) -> Result<HashSet<Self::Node>, Self::Error>;
fn descendants(
&self,
node: Self::Node,
) -> Result<HashSet<Self::Node>, Self::Error>;
// Provided methods
fn ancestors_all(
&self,
nodes: HashSet<Self::Node>,
) -> Result<HashSet<Self::Node>, Self::Error> { ... }
fn ancestor_heads(
&self,
nodes: HashSet<Self::Node>,
) -> Result<HashSet<Self::Node>, Self::Error> { ... }
fn descendant_roots(
&self,
nodes: HashSet<Self::Node>,
) -> Result<HashSet<Self::Node>, Self::Error> { ... }
fn descendants_all(
&self,
nodes: HashSet<Self::Node>,
) -> Result<HashSet<Self::Node>, Self::Error> { ... }
}Expand description
Directed acyclic graph commonly used in source control.
Implementation of Graph that represents the common case of a directed
acyclic graph in source control. You can implement this trait instead of
Graph (as there is a blanket implementation for Graph) and also make use
of BasicStrategy.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn ancestors_all(
&self,
nodes: HashSet<Self::Node>,
) -> Result<HashSet<Self::Node>, Self::Error>
fn ancestors_all( &self, nodes: HashSet<Self::Node>, ) -> Result<HashSet<Self::Node>, Self::Error>
Get the union of ancestors(node) for every node in nodes.
Sourcefn ancestor_heads(
&self,
nodes: HashSet<Self::Node>,
) -> Result<HashSet<Self::Node>, Self::Error>
fn ancestor_heads( &self, nodes: HashSet<Self::Node>, ) -> Result<HashSet<Self::Node>, Self::Error>
Filter nodes to only include nodes that are not ancestors of any other
node in nodes.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".