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,
    /* private fields */
}
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.

Implementations

Create File with specified record size, key size, root page.

Save changes to underlying storage.

Clear the cache, changes are discarded instead of being saved.

Free the underlying storage. File is not useable after this.

Insert a Record. If the key is a duplicate, the record is not saved.

Remove a Record.

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.

Mark a page as changed.

Attempt to free up logical pages by re-packing child pages.

Get the set of used logical pages.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.