Struct mut_binary_heap::PeekMut
source · pub struct PeekMut<'a, K: Hash + Eq, T: 'a, C: 'a + Compare<T>> { /* private fields */ }
Expand description
Structure wrapping a mutable reference to the first item on a
BinaryHeap
.
This struct
is created by the peek_mut
method on BinaryHeap
. See
its documentation for more.
Implementations§
source§impl<K: Hash + Eq, T, C: Compare<T>> PeekMut<'_, K, T, C>
impl<K: Hash + Eq, T, C: Compare<T>> PeekMut<'_, K, T, C>
sourcepub fn key_value(&self) -> (&K, &T)
pub fn key_value(&self) -> (&K, &T)
returns the key-value pair that is the first item on the heap.
sourcepub fn key_value_mut(&mut self) -> (&mut K, &mut T)
pub fn key_value_mut(&mut self) -> (&mut K, &mut T)
returns a mutable reference to the key-value pair that is the first item on the heap.
sourcepub fn pop_with_key(self) -> (K, T)
pub fn pop_with_key(self) -> (K, T)
Removes the peeked value from the heap and returns it as a key-value pair.