pub struct Path { /* private fields */ }
Expand description
A path from a src to a dst storing all edges in between.
Implementations
sourceimpl Path
impl Path
sourcepub fn new(
src_idx: NodeIdx,
src_id: i64,
dst_idx: NodeIdx,
dst_id: i64,
edges: Vec<EdgeIdx>
) -> Path
pub fn new(
src_idx: NodeIdx,
src_id: i64,
dst_idx: NodeIdx,
dst_id: i64,
edges: Vec<EdgeIdx>
) -> Path
ATTENTION! This method does not calculate the path’s cost.
This can be done, e.g., with calc_cost(...)
or flatten(...)
.
Accessing the costs without calculating them will lead to panics.
pub fn src_idx(&self) -> NodeIdx
pub fn dst_idx(&self) -> NodeIdx
sourcepub fn costs(&self) -> &DimVec<f64>
pub fn costs(&self) -> &DimVec<f64>
ATTENTION! This method panics if the costs hasn’t been calculated (e.g. calc_cost(...)
or flatten(...)
).
sourcepub fn calc_costs(&mut self, graph: &Graph) -> &DimVec<f64>
pub fn calc_costs(&mut self, graph: &Graph) -> &DimVec<f64>
Calculates the path’s cost, but only if not calculated already.
sourcepub fn try_flatten(self, graph: &Graph) -> Result<Path>
pub fn try_flatten(self, graph: &Graph) -> Result<Path>
Flattens shortcuts, out-of-place, and calculates the flattened path’s cost.
pub fn flatten(self, graph: &Graph) -> Path
Trait Implementations
sourceimpl<'a> IntoIterator for &'a Path
impl<'a> IntoIterator for &'a Path
sourceimpl IntoIterator for Path
impl IntoIterator for Path
impl Eq for Path
Auto Trait Implementations
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.