pub trait AStarGraph {
type Cost: Copy + PartialOrd + Add<Output = Self::Cost>;
// Required methods
fn zero_cost() -> Self::Cost;
fn max_cost() -> Self::Cost;
fn heuristic(&self, from: NodeId, to: NodeId) -> Self::Cost;
fn neighbors(&self, node: NodeId) -> Vec<(NodeId, Self::Cost)>;
}Expand description
Trait implemented by any graph that wants generic A*.
Required Associated Types§
Required Methods§
fn zero_cost() -> Self::Cost
fn max_cost() -> Self::Cost
fn heuristic(&self, from: NodeId, to: NodeId) -> Self::Cost
fn neighbors(&self, node: NodeId) -> Vec<(NodeId, Self::Cost)>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.