2016-06-09 15:49:07 -07:00
|
|
|
use super::*;
|
|
|
|
|
2018-07-01 16:54:01 -04:00
|
|
|
impl<'graph, G: DirectedGraph> DirectedGraph for &'graph G {
|
2016-06-09 15:49:07 -07:00
|
|
|
type Node = G::Node;
|
2018-07-01 16:54:01 -04:00
|
|
|
}
|
2016-06-09 15:49:07 -07:00
|
|
|
|
2018-07-01 16:54:01 -04:00
|
|
|
impl<'graph, G: WithNumNodes> WithNumNodes for &'graph G {
|
2016-06-09 15:49:07 -07:00
|
|
|
fn num_nodes(&self) -> usize {
|
|
|
|
(**self).num_nodes()
|
|
|
|
}
|
2018-07-01 16:54:01 -04:00
|
|
|
}
|
2016-06-09 15:49:07 -07:00
|
|
|
|
2018-07-01 16:54:01 -04:00
|
|
|
impl<'graph, G: WithStartNode> WithStartNode for &'graph G {
|
2016-06-09 15:49:07 -07:00
|
|
|
fn start_node(&self) -> Self::Node {
|
|
|
|
(**self).start_node()
|
|
|
|
}
|
2018-07-01 16:54:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<'graph, G: WithSuccessors> WithSuccessors for &'graph G {
|
|
|
|
fn successors<'iter>(&'iter self, node: Self::Node) -> <Self as GraphSuccessors<'iter>>::Iter {
|
|
|
|
(**self).successors(node)
|
|
|
|
}
|
|
|
|
}
|
2016-06-09 15:49:07 -07:00
|
|
|
|
2018-07-01 16:54:01 -04:00
|
|
|
impl<'graph, G: WithPredecessors> WithPredecessors for &'graph G {
|
2016-10-20 00:25:19 +05:30
|
|
|
fn predecessors<'iter>(&'iter self,
|
|
|
|
node: Self::Node)
|
|
|
|
-> <Self as GraphPredecessors<'iter>>::Iter {
|
2016-06-09 15:49:07 -07:00
|
|
|
(**self).predecessors(node)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-01 16:54:01 -04:00
|
|
|
impl<'iter, 'graph, G: WithPredecessors> GraphPredecessors<'iter> for &'graph G {
|
2016-06-09 15:49:07 -07:00
|
|
|
type Item = G::Node;
|
|
|
|
type Iter = <G as GraphPredecessors<'iter>>::Iter;
|
|
|
|
}
|
|
|
|
|
2018-07-01 16:54:01 -04:00
|
|
|
impl<'iter, 'graph, G: WithSuccessors> GraphSuccessors<'iter> for &'graph G {
|
2016-06-09 15:49:07 -07:00
|
|
|
type Item = G::Node;
|
|
|
|
type Iter = <G as GraphSuccessors<'iter>>::Iter;
|
|
|
|
}
|