pub struct PageTable { /* private fields */ }
Expand description
Page lookup table.
Implementations§
Source§impl PageTable
impl PageTable
Sourcepub async fn load<'a>(
reader: &dyn Reader,
position: usize,
min_field_id: i32,
max_field_id: i32,
num_batches: i32,
) -> Result<Self>
pub async fn load<'a>( reader: &dyn Reader, position: usize, min_field_id: i32, max_field_id: i32, num_batches: i32, ) -> Result<Self>
Load PageTable from disk.
Parameters:
position
: The start position in the file where the page table is stored.min_field_id
: The smallest field_id that is present in the schema.max_field_id
: The largest field_id that is present in the schema.num_batches
: The number of batches in the file.
The page table is stored as an array. The on-disk size is determined based
on the min_field_id
, max_field_id
, and num_batches
parameters. If
these are incorrect, the page table will not be read correctly.
The full sequence of field ids min_field_id..=max_field_id
will be loaded.
Non-existent pages will be represented as (0, 0) in the page table. Pages
can be non-existent because they are not present in the file, or because
they are struct fields which have no data pages.
Sourcepub async fn write(
&self,
writer: &mut dyn Writer,
min_field_id: i32,
) -> Result<usize>
pub async fn write( &self, writer: &mut dyn Writer, min_field_id: i32, ) -> Result<usize>
Write PageTable to disk.
min_field_id
is the smallest field_id that is present in the schema.
This might be a struct field, which has no data pages, but it still must
be serialized to the page table per the format spec.
Any (field_id, batch_id) combinations that are not present in the page table will be written as (0, 0) to indicate an empty page. This includes any holes in the field ids as well as struct fields which have no data pages.
Sourcepub fn set(&mut self, field_id: i32, batch: i32, page_info: PageInfo)
pub fn set(&mut self, field_id: i32, batch: i32, page_info: PageInfo)
Set page lookup info for a page identified by (column, batch)
pair.
pub fn get(&self, field_id: i32, batch: i32) -> Option<&PageInfo>
Trait Implementations§
Source§impl DeepSizeOf for PageTable
impl DeepSizeOf for PageTable
Source§fn deep_size_of_children(&self, context: &mut Context) -> usize
fn deep_size_of_children(&self, context: &mut Context) -> usize
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
impl StructuralPartialEq for PageTable
Auto Trait Implementations§
impl Freeze for PageTable
impl RefUnwindSafe for PageTable
impl Send for PageTable
impl Sync for PageTable
impl Unpin for PageTable
impl UnwindSafe for PageTable
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more