for_binaryheap_peek_mut

Function for_binaryheap_peek_mut 

Source
pub fn for_binaryheap_peek_mut<T>() -> WritableOptionalKeyPath<BinaryHeap<T>, T, impl for<'r> Fn(&'r mut BinaryHeap<T>)>
where T: Ord + 'static,
Expand description

Create a writable keypath for peeking at the top of BinaryHeap Note: BinaryHeap.peek_mut() returns PeekMut which is a guard type. Due to Rust’s borrowing rules, we cannot return &mut T directly from PeekMut. This function returns None as BinaryHeap doesn’t support direct mutable access through keypaths. Use heap.peek_mut() directly for mutable access.