Expand description
Materialized-path encoding for the page tree.
A page’s path is its ancestors’ row ids as hex segments
followed by its own, so ORDER BY path is a depth-first walk and a
subtree is one prefix range. This module only builds and parses
paths; tree mutations live in crate::tree_ops.
Structs§
- Materialized
Path - Helper for building, parsing, and querying materialized paths.
Enums§
Constants§
- SEGMENT_
WIDTH - Width of a materialized-path segment for ids up to 65 535: 4 hex chars.
- SEPARATOR
- WIDE_
MARKER - Marks a segment for an id above 65 535.
~sorts after every hex digit, so wide siblings order after narrow ones and by id among themselves; like any segment it ends inSEPARATOR, which sorts below every digit, so a subtree stays contiguous underORDER BY path. - WIDE_
WIDTH - Hex width of a wide segment: ids up to
u32::MAX.
Functions§
- depth_
of - Compute depth from a raw path string. Trailing-slash safe.
- descendants_
like - SQL
LIKEpattern matching every descendant ofparent_path— and the parent itself, since%matches the empty string. Callers that want descendants only addpath != parent_path. - parent_
of - Strip the last segment, returning the parent prefix (with trailing
/), or None if the path was already a single segment.