pub struct WeightedPathResult {
pub nodes: Vec<EntityId>,
pub edges: Vec<EdgeId>,
pub total_weight: f64,
pub length: usize,
}Expand description
A weighted path through the graph.
Represents a sequence of nodes and edges from a source to a target, along with the total accumulated weight.
Fields§
§nodes: Vec<EntityId>The nodes in the path, from source to target.
edges: Vec<EdgeId>The edges connecting the nodes.
Length is nodes.len() - 1.
total_weight: f64The total weight of the path.
length: usizeThe number of edges in the path.
Implementations§
Source§impl WeightedPathResult
impl WeightedPathResult
Sourcepub fn new(nodes: Vec<EntityId>, edges: Vec<EdgeId>, total_weight: f64) -> Self
pub fn new(nodes: Vec<EntityId>, edges: Vec<EdgeId>, total_weight: f64) -> Self
Create a new weighted path result.
Sourcepub fn single_node(node: EntityId) -> Self
pub fn single_node(node: EntityId) -> Self
Create a path for a single node (source == target).
Trait Implementations§
Source§impl Clone for WeightedPathResult
impl Clone for WeightedPathResult
Source§fn clone(&self) -> WeightedPathResult
fn clone(&self) -> WeightedPathResult
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 WeightedPathResult
impl Debug for WeightedPathResult
Source§impl PartialEq for WeightedPathResult
impl PartialEq for WeightedPathResult
Source§fn eq(&self, other: &WeightedPathResult) -> bool
fn eq(&self, other: &WeightedPathResult) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for WeightedPathResult
Auto Trait Implementations§
impl Freeze for WeightedPathResult
impl RefUnwindSafe for WeightedPathResult
impl Send for WeightedPathResult
impl Sync for WeightedPathResult
impl Unpin for WeightedPathResult
impl UnsafeUnpin for WeightedPathResult
impl UnwindSafe for WeightedPathResult
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