Skip to content

std::collections::heap

Status: experimental

Binary min-heap (priority queue) over Vec. Re-bind shape: let h = heap::push(h, v).

API details and source

The implementation source contains the complete declarations and implementation notes. The table below lists canonical Gossamer call signatures; every item name links directly to its implementation file.

Item Canonical signature or declaration Description
len fn len(xs: Heap<i64>) -> i64 Element count.
peek fn peek(xs: Heap<i64>) -> i64 Smallest element of the heap, or 0 if empty.
pop fn pop(xs: Heap<i64>) -> Heap<i64> Drop the root from the heap; returns the new heap (use peek first to read the value).
push fn push(xs: Heap<i64>, value: i64) -> Heap<i64> Push an i64 onto the min-heap; returns the new heap.