pub trait NodeWeightArray<WeightType> {
// Required methods
fn new(size: usize) -> Self;
fn get(&self, node_index: usize) -> WeightType;
fn get_mut<'this: 'result, 'result>(
&'this mut self,
node_index: usize,
) -> &'result mut WeightType;
fn set(&mut self, node_index: usize, weight: WeightType);
fn clear(&mut self);
fn size(&self) -> usize;
}
Expand description
An array to store minimal node weights for Dijkstra’s algorithm.
Required Methods§
Sourcefn get(&self, node_index: usize) -> WeightType
fn get(&self, node_index: usize) -> WeightType
Returns the current weight of the given node index.
Sourcefn get_mut<'this: 'result, 'result>(
&'this mut self,
node_index: usize,
) -> &'result mut WeightType
fn get_mut<'this: 'result, 'result>( &'this mut self, node_index: usize, ) -> &'result mut WeightType
Returns the current weight of the given node index as mutable reference.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.