Skip to main content

region_after_head

Function region_after_head 

Source
pub fn region_after_head(
    key: &[u8],
    head_end: usize,
) -> Result<Range<usize>, StorageError>
Expand description

Extent of the term directly following a walked head region inside a versioned key — the component the counts walks fold into their distinct-term / distinct-graph counters, and the PER_HEAD walk’s slot-1.

term_width_at validates the type byte only, so the derived extent is bounds-checked against the logical prefix (key length minus the commit timestamp): a truncated or overlapping following term is reported as StorageError::Corrupt instead of slicing into timestamp bytes, the same failure the full-quad decode this region arithmetic replaced produced. The head region itself is bounds-checked in consider_head_key.