pub trait BTreePage {
// Required methods
fn new(
pid: &BTreePageID,
bytes: &[u8],
tuple_scheme: &Schema,
key_field: usize,
) -> Self
where Self: Sized;
fn get_pid(&self) -> BTreePageID;
fn get_parent_pid(&self) -> BTreePageID;
fn set_parent_pid(&mut self, pid: &BTreePageID);
fn get_page_data(&self) -> Vec<u8> ⓘ;
fn set_before_image(&mut self);
fn get_before_image(&self) -> Vec<u8> ⓘ;
fn peek(&self);
}Required Methods§
fn new(
pid: &BTreePageID,
bytes: &[u8],
tuple_scheme: &Schema,
key_field: usize,
) -> Selfwhere
Self: Sized,
fn get_pid(&self) -> BTreePageID
fn get_parent_pid(&self) -> BTreePageID
fn set_parent_pid(&mut self, pid: &BTreePageID)
Sourcefn get_page_data(&self) -> Vec<u8> ⓘ
fn get_page_data(&self) -> Vec<u8> ⓘ
Generates a byte array representing the contents of this page. Used to serialize this page to disk.
The invariant here is that it should be possible to pass the byte array generated by get_page_data to the BTreePage constructor and have it produce an identical BTreeLeafPage object.
§Returns
A byte array representing the contents of this page.
fn set_before_image(&mut self)
Sourcefn get_before_image(&self) -> Vec<u8> ⓘ
fn get_before_image(&self) -> Vec<u8> ⓘ
Provide a representation of this page before any modifications were made to it. Used by recovery.