Skip to main content

graph_region

Function graph_region 

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

Byte region of the G term inside a versioned key: starts hops terms after the walked head’s end (graph_hops_after_head), ends at the logical prefix. The default graph’s region is empty.

Each hop is bounds-checked against the logical prefix (key length minus the commit timestamp): a truncated intermediate term is reported as StorageError::Corrupt — the descending timestamp’s first byte is 0xFF, which the width table holds at TERM_WIDTH_UNKNOWN (encode::binary), so a hop landing inside the timestamp can never masquerade as a zero-width term.