Struct rustdb::page::Page [−][src]
pub struct Page {
pub data: Data,
pub pnum: u64,
pub is_dirty: bool,
pub count: usize,
pub level: u8,
pub node_size: usize,
pub root: usize,
pub first_page: u64,
// some fields omitted
}Expand description
A page in a SortedFile. Note that left subtree has nodes that compare greater.
Fields
data: DataData storage.
pnum: u64Page number in file where page is saved.
is_dirty: boolDoes page need to be saved to backing storage?
count: usizeNumber of records currently stored in the page.
level: u8Page level. 0 means a child page, more than 0 a parent page.
node_size: usizeNumber of bytes required for each node.
root: usizeRoot node for the page.
first_page: u64First child page ( for a parent page ).
Implementations
Sets header and trailer data (if parent). Called just before page is saved to file.
Construct a new empty page inheriting record size and level from self. Used when splitting a page that is full.
Find child page number.
Returns node id of Record equal to r, or zero if no such node exists.
Insert a record into the page ( if the key is a duplicate, nothing happens, and the record is not saved ).
Insert a child page with specified key and number.
Append a child page with specified key and number.
Append record x from specified page to this page.
Offset of the client data for node x.
Get the left child node for node x. Result is zero if there is no child.
Get the right child node for node x. Result is zero if there is no child.
Get the child page number for node x in a parent page.
Set the child page for node x.
Compare record data for node x with record r.
Get record key for node x.
