Expand description
This module contains all the relevant methods to work with PageIds.
A PageId is an unique identifier for a Page in a tree of pages with branching factor 2^6 and a maximum depth of 42, with the root page counted as depth 0.
Each PageId consists of a list of numbers between 0 and 2^6 - 1, which encodes a path through the tree. The list may have between 0 and 42 (inclusive) items.
Page IDs also have a disambiguated 256-bit representation which is given by starting with a blank bit pattern, and then repeatedly shifting it to the left by 6 bits, then adding the next child index, then adding 1. This disambiguated representation uniquely encodes all the page IDs in a fixed-width bit pattern as, essentially, a base-64 integer.
Structs§
- Child
Page Index - The index of a children of a page.
- Invalid
Page IdBytes - The bytes cannot form a valid PageId because they define a PageId bigger than the biggest valid one, the rightmost Page in the last layer.
- PageId
- A unique ID for a page.
- Page
IdsIterator - Iterator of PageIds over a KeyPath, PageIds will be lazily constructed as needed
Enums§
- Child
Page IdError - Errors related to the construction of a Child PageId
Constants§
- MAX_
CHILD_ INDEX - MAX_
PAGE_ DEPTH - NUM_
CHILDREN - The number of children each Page ID has.
- ROOT_
PAGE_ ID - The root page is the one containing the sub-trie directly descending from the root node.