Struct simple_db_rust::BTreeTable[][src]

pub struct BTreeTable {
    pub key_field: usize,
    pub tuple_scheme: TupleScheme,
    // some fields omitted
}

Fields

key_field: usizetuple_scheme: TupleScheme

Implementations

impl BTreeTable[src]

pub fn new(
    file_path: &str,
    key_field: usize,
    row_scheme: TupleScheme
) -> BTreeTable
[src]

pub fn get_id(&self) -> i32[src]

pub fn insert_tuple(&self, tuple: Tuple)[src]

Insert a tuple into this BTreeFile, keeping the tuples in sorted order. May cause pages to split if the page where tuple belongs is full.

pub fn split_leaf_page(
    &self,
    page: RefMut<'_, BTreeLeafPage>,
    key_field: usize
) -> Rc<RefCell<BTreeLeafPage>>
[src]

Split a leaf page to make room for new tuples and recursively split the parent node as needed to accommodate a new entry. The new entry should have a key matching the key field of the first tuple in the right-hand page (the key is “copied up”), and child pointers pointing to the two leaf pages resulting from the split. Update sibling pointers and parent pointers as needed.

Return the leaf page into which a new tuple with key field “field” should be inserted.

pub fn find_leaf_page(
    &self,
    page_id: BTreePageID,
    field: i32
) -> Rc<RefCell<BTreeLeafPage>>
[src]

Recursive function which finds and locks the leaf page in the B+ tree corresponding to the left-most page possibly containing the key field f. It locks all internal nodes along the path to the leaf node with READ_ONLY permission, and locks the leaf node with permission perm.

If f is null, it finds the left-most leaf page – used for the iterator

pub fn get_file(&self) -> RefMut<'_, File>[src]

pub fn get_root_pid(&self) -> BTreePageID[src]

Get the root page pid.

pub fn pages_count(&self) -> usize[src]

The count of pages in this BTreeFile

(BTreeRootPointerPage is not included)

Trait Implementations

impl Display for BTreeTable[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.