pub struct PolygonPath { /* private fields */ }Expand description
Non-empty free-space polyline in scene coordinates with Euclidean cost.
Implementations§
Source§impl PolygonPath
impl PolygonPath
Sourcepub fn from_points(
points: Vec<Point2>,
) -> Result<PolygonPath, PolygonPathBuildError>
pub fn from_points( points: Vec<Point2>, ) -> Result<PolygonPath, PolygonPathBuildError>
Builds a path and sets cost to the sum of consecutive Euclidean segments.
§Errors
Returns PolygonPathBuildError::Empty when points is empty.
Sourcepub fn from_points_with_cost(
points: Vec<Point2>,
cost: f64,
) -> Result<PolygonPath, PolygonPathBuildError>
pub fn from_points_with_cost( points: Vec<Point2>, cost: f64, ) -> Result<PolygonPath, PolygonPathBuildError>
Builds a path with an explicit cost (callers must ensure consistency with the polyline).
§Errors
Returns PolygonPathBuildError::Empty when points is empty.
Sourcepub fn points(&self) -> &[Point2]
pub fn points(&self) -> &[Point2]
Ordered free-space vertices from start through goal (inclusive).
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Always false for successfully constructed paths (from_points* reject empty).
Trait Implementations§
Source§impl Clone for PolygonPath
impl Clone for PolygonPath
Source§fn clone(&self) -> PolygonPath
fn clone(&self) -> PolygonPath
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PolygonPath
impl Debug for PolygonPath
Source§impl PartialEq for PolygonPath
impl PartialEq for PolygonPath
Source§impl SearchPathCost for PolygonPath
impl SearchPathCost for PolygonPath
Source§fn path_cost(&self) -> <PolygonPath as SearchPathCost>::Cost
fn path_cost(&self) -> <PolygonPath as SearchPathCost>::Cost
Returns the path’s domain-specific traversal cost.
impl StructuralPartialEq for PolygonPath
Auto Trait Implementations§
impl Freeze for PolygonPath
impl RefUnwindSafe for PolygonPath
impl Send for PolygonPath
impl Sync for PolygonPath
impl Unpin for PolygonPath
impl UnsafeUnpin for PolygonPath
impl UnwindSafe for PolygonPath
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more