Skip to main content

max_visible_level

Function max_visible_level 

Source
pub fn max_visible_level(def_meaning: &[DefinitionInterpretation]) -> u16
Expand description

The highest definition level whose items still map to a value in the leaf array

def_meaning is ordered leaf-first, so every layer ahead of the first list layer sits underneath that list. Once a list boundary is crossed, a null (or empty) list at any outer layer has no value in the leaf at all and its item is “invisible”.

Both the writer and every decoder decide whether an item owns a value by comparing def <= max_visible_level, so the two sides must derive it the same way. When there are no lists this sums every layer, i.e. max_def, which makes all items visible.