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: Data

Data storage.

pnum: u64

Page number in file where page is saved.

is_dirty: bool

Does page need to be saved to backing storage?

count: usize

Number of records currently stored in the page.

level: u8

Page level. 0 means a child page, more than 0 a parent page.

node_size: usize

Number of bytes required for each node.

root: usize

Root node for the page.

first_page: u64

First child page ( for a parent page ).

Implementations

The size of the page in bytes.

Construct a new page.

Sets header and trailer data (if parent). Called just before page is saved to file.

Is the page full?

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.

Remove record from this page.

Offset of the client data for node x.

The client data size.

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.

Compare record data for node x with record r.

Get record key for node x.

Reduce page size using free nodes.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.