Skip to main content

normalized_layer_rank

Function normalized_layer_rank 

Source
pub const fn normalized_layer_rank(
    important: bool,
    ordinal: Option<LayerOrdinal>,
) -> LayerRank
Expand description

Maps a layer ordinal into the comparison domain used by CascadeKey.

Unlayered declarations form an implicit final layer, and the whole layer order is reversed for important declarations. This scalar encoding is sound because CascadeKey compares level before layer_rank, so normal and important declarations never rely on their shared zero value.