Struct rustdb::sortedfile::SortedFile [−][src]
pub struct SortedFile {
pub pages: RefCell<HashMap<u64, PagePtr>>,
pub dirty_pages: RefCell<Vec<PagePtr>>,
pub rec_size: usize,
pub key_size: usize,
pub root_page: u64,
pub ok: Cell<bool>,
}
Expand description
Sorted Record storage.
SortedFile is a tree of pages.
Each page is either a parent page with links to child pages, or a leaf page.
Fields
pages: RefCell<HashMap<u64, PagePtr>>
Cached pages.
dirty_pages: RefCell<Vec<PagePtr>>
List of pages that have changed.
rec_size: usize
Size of a record.
key_size: usize
Size of a key.
root_page: u64
The root page.
ok: Cell<bool>
Status
Implementations
Create File with specified record size, key size, root page.
Free the underlying storage. File is not useable after this.
Insert a Record. If the key is a duplicate, the record is not saved.
Locate a record with matching key. Result is PagePtr and offset of data.
For iteration in ascending order from start.
For iteration in descending order from start.