pub struct Engine<R> {
pub graph: DependencyGraph,
pub config: EvalConfig,
pub recalc_epoch: u64,
/* private fields */
}Fields§
§graph: DependencyGraph§config: EvalConfig§recalc_epoch: u64Implementations§
Source§impl<R> Engine<R>where
R: EvaluationContext,
impl<R> Engine<R>where
R: EvaluationContext,
pub fn new(resolver: R, config: EvalConfig) -> Self
Sourcepub fn with_thread_pool(
resolver: R,
config: EvalConfig,
thread_pool: Arc<ThreadPool>,
) -> Self
pub fn with_thread_pool( resolver: R, config: EvalConfig, thread_pool: Arc<ThreadPool>, ) -> Self
Create an Engine with a custom thread pool (for shared thread pool scenarios)
pub fn default_sheet_id(&self) -> SheetId
pub fn default_sheet_name(&self) -> &str
Sourcepub fn set_workbook_seed(&mut self, seed: u64)
pub fn set_workbook_seed(&mut self, seed: u64)
Update the workbook seed for deterministic RNGs in functions.
Sourcepub fn set_volatile_level(&mut self, level: VolatileLevel)
pub fn set_volatile_level(&mut self, level: VolatileLevel)
Set the volatile level policy (Always/OnRecalc/OnOpen)
pub fn sheet_id(&self, name: &str) -> Option<SheetId>
pub fn set_default_sheet_by_name(&mut self, name: &str)
pub fn set_default_sheet_by_id(&mut self, id: SheetId)
pub fn set_sheet_index_mode(&mut self, mode: SheetIndexMode)
Sourcepub fn mark_data_edited(&mut self)
pub fn mark_data_edited(&mut self)
Mark data edited: bump snapshot and set edited flag
Sourcepub fn sheet_store(&self) -> &SheetStore
pub fn sheet_store(&self) -> &SheetStore
Access Arrow sheet store (read-only)
Sourcepub fn sheet_store_mut(&mut self) -> &mut SheetStore
pub fn sheet_store_mut(&mut self) -> &mut SheetStore
Access Arrow sheet store (mutable)
Sourcepub fn stage_formula_text(
&mut self,
sheet: &str,
row: u32,
col: u32,
text: String,
)
pub fn stage_formula_text( &mut self, sheet: &str, row: u32, col: u32, text: String, )
Stage a formula text instead of inserting into the graph (used when deferring is enabled).
Sourcepub fn get_staged_formula_text(
&self,
sheet: &str,
row: u32,
col: u32,
) -> Option<String>
pub fn get_staged_formula_text( &self, sheet: &str, row: u32, col: u32, ) -> Option<String>
Get a staged formula text for a given cell if present (cloned).
Sourcepub fn build_graph_all(&mut self) -> Result<(), ExcelError>
pub fn build_graph_all(&mut self) -> Result<(), ExcelError>
Build graph for all staged formulas.
Sourcepub fn build_graph_for_sheets<'a, I: IntoIterator<Item = &'a str>>(
&mut self,
sheets: I,
) -> Result<(), ExcelError>
pub fn build_graph_for_sheets<'a, I: IntoIterator<Item = &'a str>>( &mut self, sheets: I, ) -> Result<(), ExcelError>
Build graph for specific sheets (consuming only those staged entries).
Sourcepub fn begin_bulk_ingest_arrow(&mut self) -> ArrowBulkIngestBuilder<'_, R>
pub fn begin_bulk_ingest_arrow(&mut self) -> ArrowBulkIngestBuilder<'_, R>
Begin bulk Arrow ingest for base values (Phase A)
Sourcepub fn begin_bulk_update_arrow(&mut self) -> ArrowBulkUpdateBuilder<'_, R>
pub fn begin_bulk_update_arrow(&mut self) -> ArrowBulkUpdateBuilder<'_, R>
Begin bulk updates to Arrow store (Phase C)
Sourcepub fn insert_rows(
&mut self,
sheet: &str,
before: u32,
count: u32,
) -> Result<ShiftSummary, EditorError>
pub fn insert_rows( &mut self, sheet: &str, before: u32, count: u32, ) -> Result<ShiftSummary, EditorError>
Insert rows (1-based) and mirror into Arrow store when enabled
Sourcepub fn delete_rows(
&mut self,
sheet: &str,
start: u32,
count: u32,
) -> Result<ShiftSummary, EditorError>
pub fn delete_rows( &mut self, sheet: &str, start: u32, count: u32, ) -> Result<ShiftSummary, EditorError>
Delete rows (1-based) and mirror into Arrow store when enabled
Sourcepub fn insert_columns(
&mut self,
sheet: &str,
before: u32,
count: u32,
) -> Result<ShiftSummary, EditorError>
pub fn insert_columns( &mut self, sheet: &str, before: u32, count: u32, ) -> Result<ShiftSummary, EditorError>
Insert columns (1-based) and mirror into Arrow store when enabled
Sourcepub fn delete_columns(
&mut self,
sheet: &str,
start: u32,
count: u32,
) -> Result<ShiftSummary, EditorError>
pub fn delete_columns( &mut self, sheet: &str, start: u32, count: u32, ) -> Result<ShiftSummary, EditorError>
Delete columns (1-based) and mirror into Arrow store when enabled
Sourcepub fn set_cell_value(
&mut self,
sheet: &str,
row: u32,
col: u32,
value: LiteralValue,
) -> Result<(), ExcelError>
pub fn set_cell_value( &mut self, sheet: &str, row: u32, col: u32, value: LiteralValue, ) -> Result<(), ExcelError>
Set a cell value
Sourcepub fn set_cell_formula(
&mut self,
sheet: &str,
row: u32,
col: u32,
ast: ASTNode,
) -> Result<(), ExcelError>
pub fn set_cell_formula( &mut self, sheet: &str, row: u32, col: u32, ast: ASTNode, ) -> Result<(), ExcelError>
Set a cell formula
Sourcepub fn bulk_set_formulas<I>(
&mut self,
sheet: &str,
items: I,
) -> Result<usize, ExcelError>
pub fn bulk_set_formulas<I>( &mut self, sheet: &str, items: I, ) -> Result<usize, ExcelError>
Bulk set many formulas on a sheet. Skips per-cell snapshot bumping and minimizes edge rebuilds.
Sourcepub fn get_cell_value(
&self,
sheet: &str,
row: u32,
col: u32,
) -> Option<LiteralValue>
pub fn get_cell_value( &self, sheet: &str, row: u32, col: u32, ) -> Option<LiteralValue>
Get a cell value
Sourcepub fn get_cell(
&self,
sheet: &str,
row: u32,
col: u32,
) -> Option<(Option<ASTNode>, Option<LiteralValue>)>
pub fn get_cell( &self, sheet: &str, row: u32, col: u32, ) -> Option<(Option<ASTNode>, Option<LiteralValue>)>
Get formula AST (if any) and current stored value for a cell
Sourcepub fn begin_batch(&mut self)
pub fn begin_batch(&mut self)
Begin batch operations - defer CSR rebuilds for better performance
Sourcepub fn evaluate_vertex(
&mut self,
vertex_id: VertexId,
) -> Result<LiteralValue, ExcelError>
pub fn evaluate_vertex( &mut self, vertex_id: VertexId, ) -> Result<LiteralValue, ExcelError>
Evaluate a single vertex. This is the core of the sequential evaluation logic for Milestone 3.1.
Sourcepub fn evaluate_until(
&mut self,
targets: &[&str],
) -> Result<EvalResult, ExcelError>
pub fn evaluate_until( &mut self, targets: &[&str], ) -> Result<EvalResult, ExcelError>
Evaluate only the necessary precedents for specific target cells (demand-driven)
Sourcepub fn evaluate_all(&mut self) -> Result<EvalResult, ExcelError>
pub fn evaluate_all(&mut self) -> Result<EvalResult, ExcelError>
Evaluate all dirty/volatile vertices
Sourcepub fn evaluate_cell(
&mut self,
sheet: &str,
row: u32,
col: u32,
) -> Result<Option<LiteralValue>, ExcelError>
pub fn evaluate_cell( &mut self, sheet: &str, row: u32, col: u32, ) -> Result<Option<LiteralValue>, ExcelError>
Convenience: demand-driven evaluation of a single cell by sheet name and row/col.
This will evaluate only the minimal set of dirty / volatile precedents required to bring the target cell up-to-date (as if a user asked for that single value), rather than scheduling a full workbook recalc. If the cell is already clean and non-volatile, no vertices will be recomputed.
Returns the (possibly newly computed) value stored for the cell afterwards. Empty cells return None. Errors are surfaced via the Result type.
Sourcepub fn evaluate_cells(
&mut self,
targets: &[(&str, u32, u32)],
) -> Result<Vec<Option<LiteralValue>>, ExcelError>
pub fn evaluate_cells( &mut self, targets: &[(&str, u32, u32)], ) -> Result<Vec<Option<LiteralValue>>, ExcelError>
Convenience: demand-driven evaluation of multiple cells; accepts a slice of
(sheet, row, col) triples. The union of required dirty / volatile precedents
is computed once and evaluated, which is typically faster than calling
evaluate_cell repeatedly for a related set of targets.
Returns the resulting values for each requested target in the same order.
Sourcepub fn get_eval_plan(
&self,
targets: &[(&str, u32, u32)],
) -> Result<EvalPlan, ExcelError>
pub fn get_eval_plan( &self, targets: &[(&str, u32, u32)], ) -> Result<EvalPlan, ExcelError>
Get the evaluation plan for target cells without actually evaluating them
Sourcepub fn evaluate_all_cancellable(
&mut self,
cancel_flag: &AtomicBool,
) -> Result<EvalResult, ExcelError>
pub fn evaluate_all_cancellable( &mut self, cancel_flag: &AtomicBool, ) -> Result<EvalResult, ExcelError>
Evaluate all dirty/volatile vertices with cancellation support
Sourcepub fn evaluate_until_cancellable(
&mut self,
targets: &[&str],
cancel_flag: &AtomicBool,
) -> Result<EvalResult, ExcelError>
pub fn evaluate_until_cancellable( &mut self, targets: &[&str], cancel_flag: &AtomicBool, ) -> Result<EvalResult, ExcelError>
Evaluate only the necessary precedents for specific target cells with cancellation support
Sourcepub fn thread_pool(&self) -> Option<&Arc<ThreadPool>>
pub fn thread_pool(&self) -> Option<&Arc<ThreadPool>>
Get access to the shared thread pool for parallel evaluation
Source§impl<R: EvaluationContext> Engine<R>
impl<R: EvaluationContext> Engine<R>
pub fn begin_bulk_ingest(&mut self) -> BulkIngestBuilder<'_>
Trait Implementations§
Source§impl<R> EvaluationContext for Engine<R>where
R: EvaluationContext,
impl<R> EvaluationContext for Engine<R>where
R: EvaluationContext,
Source§fn resolve_range_view<'c>(
&'c self,
reference: &ReferenceType,
current_sheet: &str,
) -> Result<RangeView<'c>, ExcelError>
fn resolve_range_view<'c>( &'c self, reference: &ReferenceType, current_sheet: &str, ) -> Result<RangeView<'c>, ExcelError>
New: resolve a reference into a RangeView (Phase 2 API)
Source§fn thread_pool(&self) -> Option<&Arc<ThreadPool>>
fn thread_pool(&self) -> Option<&Arc<ThreadPool>>
Source§fn cancellation_token(&self) -> Option<&AtomicBool>
fn cancellation_token(&self) -> Option<&AtomicBool>
Source§fn chunk_hint(&self) -> Option<usize>
fn chunk_hint(&self) -> Option<usize>
Source§fn volatile_level(&self) -> VolatileLevel
fn volatile_level(&self) -> VolatileLevel
Source§fn workbook_seed(&self) -> u64
fn workbook_seed(&self) -> u64
Source§fn recalc_epoch(&self) -> u64
fn recalc_epoch(&self) -> u64
Source§fn used_rows_for_columns(
&self,
sheet: &str,
start_col: u32,
end_col: u32,
) -> Option<(u32, u32)>
fn used_rows_for_columns( &self, sheet: &str, start_col: u32, end_col: u32, ) -> Option<(u32, u32)>
Source§fn used_cols_for_rows(
&self,
sheet: &str,
start_row: u32,
end_row: u32,
) -> Option<(u32, u32)>
fn used_cols_for_rows( &self, sheet: &str, start_row: u32, end_row: u32, ) -> Option<(u32, u32)>
Source§fn sheet_bounds(&self, sheet: &str) -> Option<(u32, u32)>
fn sheet_bounds(&self, sheet: &str) -> Option<(u32, u32)>
Source§fn data_snapshot_id(&self) -> u64
fn data_snapshot_id(&self) -> u64
Source§fn backend_caps(&self) -> BackendCaps
fn backend_caps(&self) -> BackendCaps
Source§fn arrow_fastpath_enabled(&self) -> bool
fn arrow_fastpath_enabled(&self) -> bool
Source§fn date_system(&self) -> DateSystem
fn date_system(&self) -> DateSystem
Source§fn build_criteria_mask(
&self,
view: &ArrowRangeView<'_>,
col_in_view: usize,
pred: &CriteriaPredicate,
) -> Option<Arc<BooleanArray>>
fn build_criteria_mask( &self, view: &ArrowRangeView<'_>, col_in_view: usize, pred: &CriteriaPredicate, ) -> Option<Arc<BooleanArray>>
Source§fn timezone(&self) -> &TimeZoneSpec
fn timezone(&self) -> &TimeZoneSpec
Source§impl<R> FunctionProvider for Engine<R>where
R: EvaluationContext,
impl<R> FunctionProvider for Engine<R>where
R: EvaluationContext,
Source§impl<R> NamedRangeResolver for Engine<R>where
R: EvaluationContext,
impl<R> NamedRangeResolver for Engine<R>where
R: EvaluationContext,
fn resolve_named_range_reference( &self, name: &str, ) -> Result<Vec<Vec<LiteralValue>>, ExcelError>
Source§impl<R> RangeResolver for Engine<R>where
R: EvaluationContext,
impl<R> RangeResolver for Engine<R>where
R: EvaluationContext,
Source§impl<R> ReferenceResolver for Engine<R>where
R: EvaluationContext,
impl<R> ReferenceResolver for Engine<R>where
R: EvaluationContext,
fn resolve_cell_reference( &self, sheet: Option<&str>, row: u32, col: u32, ) -> Result<LiteralValue, ExcelError>
Source§impl<R> Resolver for Engine<R>where
R: EvaluationContext,
impl<R> Resolver for Engine<R>where
R: EvaluationContext,
fn resolve_range_like( &self, r: &ReferenceType, ) -> Result<Box<dyn Range>, ExcelError>
Source§impl<R> TableResolver for Engine<R>where
R: EvaluationContext,
impl<R> TableResolver for Engine<R>where
R: EvaluationContext,
fn resolve_table_reference( &self, tref: &TableReference, ) -> Result<Box<dyn Table>, ExcelError>
Auto Trait Implementations§
impl<R> !Freeze for Engine<R>
impl<R> !RefUnwindSafe for Engine<R>
impl<R> Send for Engine<R>where
R: Send,
impl<R> Sync for Engine<R>where
R: Sync,
impl<R> Unpin for Engine<R>where
R: Unpin,
impl<R> !UnwindSafe for Engine<R>
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> 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