Trait rs_graph::collections::ItemPriQueue [−][src]
pub trait ItemPriQueue<K, V> {
type Item;
fn is_empty(&self) -> bool;
fn clear(&mut self);
fn push(&mut self, key: K, value: V) -> Self::Item;
fn decrease_key(&mut self, item: &mut Self::Item, value: V) -> bool;
fn pop_min(&mut self) -> Option<(K, V)>;
fn value(&self, item: &Self::Item) -> &V;
}Associated Types
Loading content...Required methods
fn is_empty(&self) -> bool[src]
Return true iff the queue contains no element.
fn clear(&mut self)[src]
Remove all elements from the queue.
fn push(&mut self, key: K, value: V) -> Self::Item[src]
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[src]
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)>[src]
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[src]
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]
impl<'a, P, K, V> ItemPriQueue<K, V> for &'a mut P where
P: ItemPriQueue<K, 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]
impl<K, V, ID> ItemPriQueue<K, V> for BinHeap<K, V, ID> where
K: Clone,
V: PartialOrd + Clone,
ID: FromPrimitive + ToPrimitive + Copy + Eq, [src]