[−][src]Trait rs_graph::collections::ItemPriQueue
Associated Types
type Item
Handle for an item in the queue.
Required methods
fn is_empty(&self) -> bool
Return true
iff the queue contains no element.
fn clear(&mut self)
Remove all elements from the queue.
fn push(&mut self, key: K, value: V) -> Self::Item
Push the element with given key
and value
onto the queue.
Return a handle referencing the element. That handle can be used in a
subsequent call to decrease_key
.
fn decrease_key(&mut self, item: &mut Self::Item, value: V) -> bool
Decrease the value of some item in the queue.
Returns true
if the new value is smaller than the old one.
fn pop_min(&mut self) -> Option<(K, V)>
Remove and return the element with the smallest value from the queue or None
if
the queue is empty.
fn value(&self, item: &Self::Item) -> &V
Return the current value associated with some item in the queue.
Implementations on Foreign Types
impl<'a, P, K, V> ItemPriQueue<K, V> for &'a mut P where
P: ItemPriQueue<K, V>,
[src]
P: ItemPriQueue<K, V>,
type Item = P::Item
fn is_empty(&self) -> bool
[src]
fn clear(&mut self)
[src]
fn push(&mut self, key: K, value: V) -> Self::Item
[src]
fn decrease_key(&mut self, item: &mut Self::Item, value: V) -> bool
[src]
fn pop_min(&mut self) -> Option<(K, V)>
[src]
fn value(&self, item: &Self::Item) -> &V
[src]
Implementors
impl<K, V, ID> ItemPriQueue<K, V> for BinHeap<K, V, ID> where
K: Clone,
V: PartialOrd + Clone,
ID: FromPrimitive + ToPrimitive + Copy + Eq,
[src]
K: Clone,
V: PartialOrd + Clone,
ID: FromPrimitive + ToPrimitive + Copy + Eq,