pub struct Page {
pub page_number: u32,
pub data: Vec<u8>,
pub page_type: PageType,
pub cell_count: u16,
pub first_cell_offset: u16,
pub fragmented_free_bytes: u8,
pub right_pointer: Option<u32>,
}
Expand description
Represents a page in the SQLite database
Fields§
§page_number: u32
Page number (1-indexed)
data: Vec<u8>
Raw page data
page_type: PageType
Page type
cell_count: u16
Number of cells on this page
first_cell_offset: u16
Offset to first cell
fragmented_free_bytes: u8
Number of fragmented free bytes
right_pointer: Option<u32>
Right-most pointer (for interior pages)
Implementations§
Source§impl Page
impl Page
Sourcepub fn parse(page_number: u32, data: &[u8], is_first_page: bool) -> Result<Self>
pub fn parse(page_number: u32, data: &[u8], is_first_page: bool) -> Result<Self>
Parse a page from raw bytes
Sourcepub fn cell_pointers(&self, is_first_page: bool) -> Result<Vec<u16>>
pub fn cell_pointers(&self, is_first_page: bool) -> Result<Vec<u16>>
Get the cell pointer array
Sourcepub fn cell_content(&self, offset: u16) -> Result<&[u8]>
pub fn cell_content(&self, offset: u16) -> Result<&[u8]>
Get cell content at the given offset
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Page
impl RefUnwindSafe for Page
impl Send for Page
impl Sync for Page
impl Unpin for Page
impl UnwindSafe for Page
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more