pub struct QueueNode<Idx, T>where
Idx: RawIndex,{ /* private fields */ }
Expand description
A node in the priority queue for Dijkstra’s algorithm
Implementations§
Source§impl<Idx, T> QueueNode<Idx, T>where
Idx: RawIndex,
impl<Idx, T> QueueNode<Idx, T>where
Idx: RawIndex,
Sourcepub const fn new(cost: T, vertex: VertexId<Idx>) -> Self
pub const fn new(cost: T, vertex: VertexId<Idx>) -> Self
Creates a new QueueNode
with the given cost and vertex.
Sourcepub fn from_cost(cost: T) -> Selfwhere
Idx: Default,
pub fn from_cost(cost: T) -> Selfwhere
Idx: Default,
create a new node with the given cost and a default vertex
Sourcepub fn from_vertex(vertex: VertexId<Idx>) -> Selfwhere
T: Default,
pub fn from_vertex(vertex: VertexId<Idx>) -> Selfwhere
T: Default,
create a new node with the given vertex and a default cost
Sourcepub const fn vertex(&self) -> &VertexId<Idx>
pub const fn vertex(&self) -> &VertexId<Idx>
returns an immutable reference to the vertex of the node
Sourcepub const fn vertex_mut(&mut self) -> &mut VertexId<Idx>
pub const fn vertex_mut(&mut self) -> &mut VertexId<Idx>
returns a mutable reference to the vertex of the node
Sourcepub fn set_cost(&mut self, cost: T) -> &mut Self
pub fn set_cost(&mut self, cost: T) -> &mut Self
update the current cost and return a mutable reference to the node
Sourcepub fn set_vertex(&mut self, vertex: VertexId<Idx>) -> &mut Self
pub fn set_vertex(&mut self, vertex: VertexId<Idx>) -> &mut Self
update the current vertex and return a mutable reference to the node
Sourcepub fn with_cost(self, cost: T) -> Self
pub fn with_cost(self, cost: T) -> Self
consumes the current instance to create another with the given cost
Sourcepub fn with_vertex(self, vertex: VertexId<Idx>) -> Self
pub fn with_vertex(self, vertex: VertexId<Idx>) -> Self
consumes the current instance to create another with the given vertex
Trait Implementations§
Source§impl<Idx, T> Ord for QueueNode<Idx, T>
impl<Idx, T> Ord for QueueNode<Idx, T>
Source§impl<'a, Idx, T> PartialOrd<&'a QueueNode<Idx, T>> for QueueNode<Idx, T>
impl<'a, Idx, T> PartialOrd<&'a QueueNode<Idx, T>> for QueueNode<Idx, T>
Source§impl<'a, Idx, T> PartialOrd<&'a mut QueueNode<Idx, T>> for QueueNode<Idx, T>
impl<'a, Idx, T> PartialOrd<&'a mut QueueNode<Idx, T>> for QueueNode<Idx, T>
Source§impl<Idx, T> PartialOrd<QueueNode<Idx, T>> for &QueueNode<Idx, T>
impl<Idx, T> PartialOrd<QueueNode<Idx, T>> for &QueueNode<Idx, T>
Source§impl<Idx, T> PartialOrd<QueueNode<Idx, T>> for &mut QueueNode<Idx, T>
impl<Idx, T> PartialOrd<QueueNode<Idx, T>> for &mut QueueNode<Idx, T>
Source§impl<Idx, T> PartialOrd for QueueNode<Idx, T>
impl<Idx, T> PartialOrd for QueueNode<Idx, T>
impl<Idx, T: Copy> Copy for QueueNode<Idx, T>
impl<Idx, T> Eq for QueueNode<Idx, T>
Auto Trait Implementations§
impl<Idx, T> Freeze for QueueNode<Idx, T>
impl<Idx, T> RefUnwindSafe for QueueNode<Idx, T>where
T: RefUnwindSafe,
Idx: RefUnwindSafe,
impl<Idx, T> Send for QueueNode<Idx, T>where
T: Send,
impl<Idx, T> Sync for QueueNode<Idx, T>where
T: Sync,
impl<Idx, T> Unpin for QueueNode<Idx, T>
impl<Idx, T> UnwindSafe for QueueNode<Idx, T>where
T: UnwindSafe,
Idx: UnwindSafe,
Blanket Implementations§
Source§impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.