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.
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, T, C> Freeze for PeekMut<'a, K, T, C>
impl<'a, K, T, C> !RefUnwindSafe for PeekMut<'a, K, T, C>
impl<'a, K, T, C> Send for PeekMut<'a, K, T, C>
impl<'a, K, T, C> !Sync for PeekMut<'a, K, T, C>
impl<'a, K, T, C> Unpin for PeekMut<'a, K, T, C>
impl<'a, K, T, C> !UnwindSafe for PeekMut<'a, K, T, C>
Blanket Implementations§
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