pub trait ItemPriQueue<K, V> {
type Item;
// Required methods
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;
}Required Associated Types§
Required Methods§
Sourcefn push(&mut self, key: K, value: V) -> Self::Item
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.
Sourcefn decrease_key(&mut self, item: &mut Self::Item, value: V) -> bool
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".