Skip to main content

define_heap_types

Macro define_heap_types 

Source
macro_rules! define_heap_types {
    () => { ... };
}
Expand description

All HeapValue variant data lives here as a single source of truth.

Because Rust macro hygiene makes it impossible to use identifiers across macro boundaries (the _v in a pattern introduced by one macro cannot be referenced by tokens captured from a different call site), we define both the variant table AND the dispatch expressions in the SAME macro.

define_heap_types! takes no arguments — the variant table is embedded. The public types and impl blocks are generated inside the expansion.

Callers import this via crate::define_heap_types!().