pub trait PolygonShortestPathMap {
// Required methods
fn name(&self) -> &'static str;
fn source(&self) -> Point2;
fn query(
&self,
goal: Point2,
) -> Result<SearchOutcome<PolygonPath, PolygonSearchStats>, PolygonSearchError>;
}Expand description
Prepared map that answers shortest-path queries from a fixed source.
Built once via PolygonShortestPathMapBuilder; subsequent query calls
must use goals in the same scene geometry the map was prepared from.
Required Methods§
Sourcefn query(
&self,
goal: Point2,
) -> Result<SearchOutcome<PolygonPath, PolygonSearchStats>, PolygonSearchError>
fn query( &self, goal: Point2, ) -> Result<SearchOutcome<PolygonPath, PolygonSearchStats>, PolygonSearchError>
Shortest free-space path from Self::source to goal.
Invalid goals (non-traversable free space, including sealed boundary)
return PolygonSearchError::InvalidGoal.
Reachable goals return a Euclidean polyline; unreachable valid goals
return no-path (NoPath outcome), not a validation error.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".