pub struct ArrowSheet {
pub name: Arc<str>,
pub date_system: DateSystem,
pub columns: Vec<ArrowColumn>,
pub nrows: u32,
pub chunk_starts: Vec<usize>,
pub chunk_rows: usize,
}Fields§
§name: Arc<str>§date_system: DateSystemSerial encoding used by every temporal lane in this sheet.
Changing this value requires re-encoding all temporal cells; engine and workbook constructors therefore set it once when the sheet is created.
columns: Vec<ArrowColumn>§nrows: u32§chunk_starts: Vec<usize>§chunk_rows: usizePreferred chunk size (rows) for capacity growth operations.
For Arrow-ingested sheets this matches the ingest chunk_rows. For sparse/overlay-created
sheets this defaults to 32k to avoid creating thousands of tiny chunks during growth.
Implementations§
Source§impl ArrowSheet
impl ArrowSheet
Sourcepub fn new_sparse(
sheet_name: &str,
ncols: usize,
nrows: usize,
chunk_rows: usize,
) -> Self
pub fn new_sparse( sheet_name: &str, ncols: usize, nrows: usize, chunk_rows: usize, ) -> Self
Create a logical sheet whose cells are initially implicit empty values.
Columns start with no materialized chunks; callers can populate only touched
column/chunk pairs via set_sparse_overlay_value. Missing chunks remain
observable as empty cells through scalar and range reads.
Sourcepub fn new_sparse_with_date_system(
sheet_name: &str,
ncols: usize,
nrows: usize,
chunk_rows: usize,
date_system: DateSystem,
) -> Self
pub fn new_sparse_with_date_system( sheet_name: &str, ncols: usize, nrows: usize, chunk_rows: usize, date_system: DateSystem, ) -> Self
Create a sparse sheet using an explicitly selected workbook date system.
Sourcepub fn set_sparse_overlay_value(
&mut self,
abs_row: usize,
abs_col: usize,
value: OverlayValue,
) -> isize
pub fn set_sparse_overlay_value( &mut self, abs_row: usize, abs_col: usize, value: OverlayValue, ) -> isize
Populate a single sparse cell using the overlay cascade while preserving implicit-empty chunks elsewhere. This is intended for sparse initial ingest, not for user edits; no graph/changelog side effects are triggered here.
Sourcepub fn shape(&self) -> Vec<ColumnShape>
pub fn shape(&self) -> Vec<ColumnShape>
Return a summary of each column’s chunk counts, total rows, and lane presence.
pub fn range_view( &self, sr: usize, sc: usize, er: usize, ec: usize, ) -> RangeView<'_>
Sourcepub fn get_cell_value(&self, abs_row: usize, abs_col: usize) -> LiteralValue
pub fn get_cell_value(&self, abs_row: usize, abs_col: usize) -> LiteralValue
Fast single-cell read (0-based row/col) with overlay precedence.
This avoids constructing a 1x1 RangeView and is intended for tight read loops.
Sourcepub fn ensure_row_capacity(&mut self, target_rows: usize)
pub fn ensure_row_capacity(&mut self, target_rows: usize)
Ensure capacity to address at least target_rows rows by extending the row chunk map.
This updates chunk_starts/nrows but does not eagerly densify all columns with
new empty chunks. Missing chunks are treated as all-empty and can be materialized lazily.
Sourcepub fn ensure_column_chunk_mut(
&mut self,
col_idx: usize,
ch_idx: usize,
) -> Option<&mut ColumnChunk>
pub fn ensure_column_chunk_mut( &mut self, col_idx: usize, ch_idx: usize, ) -> Option<&mut ColumnChunk>
Ensure a mutable chunk for a given column/chunk index.
If the chunk is beyond the column’s dense chunk vector, it is stored in sparse_chunks.
Sourcepub fn chunk_of_row(&self, abs_row: usize) -> Option<(usize, usize)>
pub fn chunk_of_row(&self, abs_row: usize) -> Option<(usize, usize)>
Return (chunk_idx, in_chunk_offset) for absolute 0-based row.
Sourcepub fn maybe_compact_chunk(
&mut self,
col_idx: usize,
ch_idx: usize,
abs_threshold: usize,
frac_den: usize,
) -> usize
pub fn maybe_compact_chunk( &mut self, col_idx: usize, ch_idx: usize, abs_threshold: usize, frac_den: usize, ) -> usize
Heuristic compaction: rebuilds a chunk’s base arrays by applying its overlay when overlay density crosses thresholds. Returns true if a rebuild occurred.
Sourcepub fn compact_computed_overlay_chunk(
&mut self,
col_idx: usize,
ch_idx: usize,
) -> usize
pub fn compact_computed_overlay_chunk( &mut self, col_idx: usize, ch_idx: usize, ) -> usize
Compact a dense chunk’s computed overlay into its base arrays, freeing overlay memory while preserving the data. Returns the number of bytes freed.
This is the computed-overlay counterpart of maybe_compact_chunk (which compacts
user-edit overlays). The read cascade is overlay → computed_overlay → base, so
folding computed overlay entries into base arrays is transparent: the overlay layer
(user edits) is left untouched and still takes precedence on reads.
Sourcepub fn compact_computed_overlay_sparse_chunk(
&mut self,
col_idx: usize,
ch_idx: usize,
) -> usize
pub fn compact_computed_overlay_sparse_chunk( &mut self, col_idx: usize, ch_idx: usize, ) -> usize
Compact a sparse chunk’s computed overlay into its base arrays.
Equivalent to compact_computed_overlay_chunk but for sparse chunks.
Sourcepub fn insert_rows(&mut self, before: usize, count: usize)
pub fn insert_rows(&mut self, before: usize, count: usize)
Insert count rows before absolute 0-based row before.
Sourcepub fn delete_rows(&mut self, start: usize, count: usize)
pub fn delete_rows(&mut self, start: usize, count: usize)
Delete count rows starting from absolute 0-based row start.
Sourcepub fn insert_columns(&mut self, before: usize, count: usize)
pub fn insert_columns(&mut self, before: usize, count: usize)
Insert count columns before absolute 0-based column before with empty chunks.
Sourcepub fn delete_columns(&mut self, start: usize, count: usize)
pub fn delete_columns(&mut self, start: usize, count: usize)
Delete count columns starting at absolute 0-based column start.
Trait Implementations§
Source§impl Clone for ArrowSheet
impl Clone for ArrowSheet
Source§fn clone(&self) -> ArrowSheet
fn clone(&self) -> ArrowSheet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ArrowSheet
impl !UnwindSafe for ArrowSheet
impl Freeze for ArrowSheet
impl Send for ArrowSheet
impl Sync for ArrowSheet
impl Unpin for ArrowSheet
impl UnsafeUnpin for ArrowSheet
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> 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