pub struct HeapEntry {
pub value: GcRef,
pub descriptor: &'static TypeDescriptor,
}Expand description
A max-heap entry: the element GcRef plus its descriptor. Ord dispatches
to the descriptor’s compare callback (ADR-045). MaxHeap uses this
directly; MinHeap wraps it in Reverse.
Fields§
§value: GcRefThe element value.
descriptor: &'static TypeDescriptorThe element’s descriptor (for trace/equals/hash/format/compare).
Trait Implementations§
impl Copy for HeapEntry
impl Eq for HeapEntry
Source§impl Ord for HeapEntry
impl Ord for HeapEntry
Source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
The element type’s own order, through its descriptor (ADR-045).
Two answers are Equal for a reason rather than by accident: entries
whose descriptors differ (which a homogeneous heap never has, so this is
the miscompile case) and an element type with no ordering at all. There
is no fault channel inside Ord, and a heap whose comparisons are all
Equal is a consistent total order — the heap degrades to a bag instead
of corrupting its sift invariants. What it must never do is read every
payload as an i64: that puts -2.0 after -1.0 and reads four bytes
past a Char.