Expand description
Lexicographic rank for fractional indexing.
Backlog order is stored as a string that sorts lexicographically. Because a gap can always be generated between two ranks, reordering an item only rewrites that one item — neighbors keep their ranks, so insertion and movement are O(1) writes.
The internal representation is a base-36 (0-9a-z) digit string read as the fraction
0.d1 d2 …. In ASCII the ordering 0–9 < a–z matches the numeric order of the digits, so
a plain string comparison is already numeric sort order. Digit values stay in 0..36, so all
internal arithmetic uses u8.
It is implemented in-house rather than pulling in a crate: in line with the project’s
minimal-dependency policy, the logic fits in a few dozen lines of std-only code
(see docs/DESIGN.md).
Structs§
- Rank
- Comparable ranks ordered lexicographically.
- Rank
Stats - Rank-length statistics used to decide whether
Rank::rebalanceis needed.