pub struct InterpolatedPath { /* private fields */ }Expand description
Continuous polyline over a grid with an associated traversal cost.
Construct via Self::from_points (trusted cost) or
Self::from_points_on_grid (validated geometry + derived cost).
Implementations§
Source§impl InterpolatedPath
impl InterpolatedPath
Sourcepub fn from_points(
points: Vec<Point2>,
cost: f64,
) -> Result<InterpolatedPath, InterpolatedPathBuildError>
pub fn from_points( points: Vec<Point2>, cost: f64, ) -> Result<InterpolatedPath, InterpolatedPathBuildError>
Builds a path from vertices and a precomputed cost without grid checks.
Prefer Self::from_points_on_grid when geometry and cost must be
validated against a concrete grid.
§Errors
Returns InterpolatedPathBuildError::Empty when points is empty.
Sourcepub fn from_points_on_grid(
grid: &Grid,
points: Vec<Point2>,
cost_model: InterpolatedTraversalCostModel,
) -> Result<InterpolatedPath, InterpolatedPathBuildError>
pub fn from_points_on_grid( grid: &Grid, points: Vec<Point2>, cost_model: InterpolatedTraversalCostModel, ) -> Result<InterpolatedPath, InterpolatedPathBuildError>
Constructs a validated interpolated path and derives its cost from grid.
§Errors
Returns InterpolatedPathBuildError when points is empty, a point is
non-finite, outside the grid, or blocked, a segment crosses non-walkable
space, or the selected cost model produces a non-finite cost.
Trait Implementations§
Source§impl Clone for InterpolatedPath
impl Clone for InterpolatedPath
Source§fn clone(&self) -> InterpolatedPath
fn clone(&self) -> InterpolatedPath
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 InterpolatedPath
impl Debug for InterpolatedPath
Source§impl PartialEq for InterpolatedPath
impl PartialEq for InterpolatedPath
impl StructuralPartialEq for InterpolatedPath
Auto Trait Implementations§
impl Freeze for InterpolatedPath
impl RefUnwindSafe for InterpolatedPath
impl Send for InterpolatedPath
impl Sync for InterpolatedPath
impl Unpin for InterpolatedPath
impl UnsafeUnpin for InterpolatedPath
impl UnwindSafe for InterpolatedPath
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more