pub trait CommonProperties<'a, T: GraphType>: GraphBasics<'a> {
// Required methods
fn graph_type(&self) -> T;
fn costed_neighbours<F, K>(
&'a self,
node_index: <Self as GraphBasics<'a>>::NodeIndex,
cost: F,
) -> impl Iterator<Item = (K, HashSet<Self::NodeIndex>)>
where F: Fn(<Self as GraphBasics<'a>>::EdgeIndex) -> K;
fn costed_pairs<F, K>(
&'a self,
cost: F,
) -> (bool, impl Iterator<Item = (K, Vec<(Self::NodeIndex, Self::NodeIndex)>)>)
where F: Fn(<Self as GraphBasics<'a>>::EdgeIndex) -> K;
fn neighbours_or_out_neighbours(
&'a self,
node_index: <Self as GraphBasics<'a>>::NodeIndex,
) -> Option<impl Iterator<Item = Self::NodeIndex>>;
fn connects_nodes(
&'a self,
n1: Self::NodeIndex,
n2: Self::NodeIndex,
e: Self::EdgeIndex,
) -> bool;
// Provided methods
fn visit_map(&'a self) -> FixedBitSet { ... }
fn is_empty(&'a self) -> bool { ... }
fn neighbours_with_edges(
&'a self,
node_index: <Self as GraphBasics<'a>>::NodeIndex,
) -> impl Iterator<Item = (Self::EdgeIndex, HashSet<Self::NodeIndex>)> { ... }
}Expand description
Special trait for algorithm stuff.
It pained me physically to make two copies of an algorithm. This was originally made for the costed_neighbours method,
but more showed up.
So all of this.
Required Methods§
fn graph_type(&self) -> T
fn costed_neighbours<F, K>( &'a self, node_index: <Self as GraphBasics<'a>>::NodeIndex, cost: F, ) -> impl Iterator<Item = (K, HashSet<Self::NodeIndex>)>
fn costed_pairs<F, K>( &'a self, cost: F, ) -> (bool, impl Iterator<Item = (K, Vec<(Self::NodeIndex, Self::NodeIndex)>)>)
fn neighbours_or_out_neighbours( &'a self, node_index: <Self as GraphBasics<'a>>::NodeIndex, ) -> Option<impl Iterator<Item = Self::NodeIndex>>
fn connects_nodes( &'a self, n1: Self::NodeIndex, n2: Self::NodeIndex, e: Self::EdgeIndex, ) -> bool
Provided Methods§
fn visit_map(&'a self) -> FixedBitSet
fn is_empty(&'a self) -> bool
fn neighbours_with_edges( &'a self, node_index: <Self as GraphBasics<'a>>::NodeIndex, ) -> impl Iterator<Item = (Self::EdgeIndex, HashSet<Self::NodeIndex>)>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".