pub struct RecordingContext<'a, R: EvaluationContext> { /* private fields */ }Expand description
Delegating EvaluationContext that wraps &Engine<R> and records reads
into a LiveEdgeCollector.
Interception points (everything else is pure delegation):
EvaluationContext::resolve_cell_reference_value— the interpreter’s scalar read path (current-sheet aware).EvaluationContext::resolve_range_view— the single choke point for range, named-range, table and dynamic (INDIRECT/OFFSET) reads. The engine resolves un/partially-bounded references to concrete used-region bounds, and the returned view carries the resolved sheet + rect, so we record exactly that rect once. Views materialised from owned rows (array literals, named literals/formulas) carry the synthetic"__tmp"sheet, which has noSheetId, so they are skipped automatically.ReferenceResolver::resolve_cell_reference— sheet-qualified scalar reads (e.g. implicit intersection).RangeResolver::resolve_range_reference— legacy boxed-range path; the rect is resolved via the engine’s ownresolve_range_viewnormalisation so unbounded references record their used-region bounds.
Not recordable at this layer (Stage 2 follow-ups, noted in tests):
NamedRangeResolver::resolve_named_range_reference— values-only API with no sheet/region context. The engine-level named-range path flows throughresolve_range_view(intercepted); only the external-resolver fallback is invisible.TableResolver::resolve_table_reference— returns an opaqueTable. Engine-registered tables flow throughresolve_range_view(intercepted).
Implementations§
Source§impl<'a, R: EvaluationContext> RecordingContext<'a, R>
impl<'a, R: EvaluationContext> RecordingContext<'a, R>
pub fn new(engine: &'a Engine<R>, collector: &'a LiveEdgeCollector) -> Self
Trait Implementations§
Source§impl<'a, R: EvaluationContext> EvaluationContext for RecordingContext<'a, R>
impl<'a, R: EvaluationContext> EvaluationContext for RecordingContext<'a, R>
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>
Resolve a reference into a
RangeView with clear bounds.
Implementations should resolve un/partially bounded references using used-region.Source§fn resolve_cell_reference_value(
&self,
sheet: Option<&str>,
row: u32,
col: u32,
current_sheet: &str,
) -> Result<LiteralValue, ExcelError>
fn resolve_cell_reference_value( &self, sheet: Option<&str>, row: u32, col: u32, current_sheet: &str, ) -> Result<LiteralValue, ExcelError>
Resolve a single-cell reference as a scalar value. Read more
Source§fn thread_pool(&self) -> Option<&Arc<ThreadPool>>
fn thread_pool(&self) -> Option<&Arc<ThreadPool>>
Get access to the shared thread pool for parallel evaluation
Returns None if parallel evaluation is disabled or unavailable
Source§fn cancellation_token(&self) -> Option<Arc<AtomicBool>>
fn cancellation_token(&self) -> Option<Arc<AtomicBool>>
Optional cancellation token. When Some, long-running operations should periodically abort.
Source§fn chunk_hint(&self) -> Option<usize>
fn chunk_hint(&self) -> Option<usize>
Optional chunk size hint for streaming visitors.
Source§fn workbook_sheet_count(&self) -> Option<usize>
fn workbook_sheet_count(&self) -> Option<usize>
Number of active sheets in the workbook, if known.
Source§fn sheet_index_by_name(&self, sheet: &str) -> Option<usize>
fn sheet_index_by_name(&self, sheet: &str) -> Option<usize>
Excel-style 1-based active-sheet index for a sheet name, if known.
Source§fn current_sheet_index(&self, current_sheet: &str) -> Option<usize>
fn current_sheet_index(&self, current_sheet: &str) -> Option<usize>
Excel-style 1-based active-sheet index for the current formula sheet, if known.
Source§fn inspect_reference(
&self,
reference: &ReferenceType,
current_sheet: &str,
) -> Result<Option<ReferenceInfo>, ExcelError>
fn inspect_reference( &self, reference: &ReferenceType, current_sheet: &str, ) -> Result<Option<ReferenceInfo>, ExcelError>
Inspect reference metadata without materializing referenced values.
Source§fn formula_text_at_cell(
&self,
cell: CellRef,
) -> Result<Option<String>, ExcelError>
fn formula_text_at_cell( &self, cell: CellRef, ) -> Result<Option<String>, ExcelError>
Retrieve formula text for a concrete cell, if that cell stores a formula.
Source§fn clock(&self) -> &dyn ClockProvider
fn clock(&self) -> &dyn ClockProvider
Clock provider for volatile date/time builtins. Read more
Source§fn timezone(&self) -> &TimeZoneSpec
fn timezone(&self) -> &TimeZoneSpec
Timezone spec for date/time functions. Read more
Source§fn volatile_level(&self) -> VolatileLevel
fn volatile_level(&self) -> VolatileLevel
Volatile granularity. Default Always for backwards compatibility.
Source§fn workbook_seed(&self) -> u64
fn workbook_seed(&self) -> u64
A stable workbook seed for RNG composition.
Source§fn recalc_epoch(&self) -> u64
fn recalc_epoch(&self) -> u64
Recalc epoch that increments on each full recalc when appropriate.
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)>
Optional: Return the min/max used rows for a set of columns on a sheet.
When None, the backend does not provide used-region hints.
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)>
Optional: Return the min/max used columns for a set of rows on a sheet.
When None, the backend does not provide used-region hints.
Source§fn sheet_bounds(&self, sheet: &str) -> Option<(u32, u32)>
fn sheet_bounds(&self, sheet: &str) -> Option<(u32, u32)>
Optional: Physical sheet bounds (max rows, max cols) if known.
Source§fn data_snapshot_id(&self) -> u64
fn data_snapshot_id(&self) -> u64
Monotonic identifier for the current data snapshot; increments on mutation.
Source§fn backend_caps(&self) -> BackendCaps
fn backend_caps(&self) -> BackendCaps
Backend capability advertisement for IO/adapters.
Source§fn date_system(&self) -> DateSystem
fn date_system(&self) -> DateSystem
Workbook date system selection (1900 vs 1904).
Defaults to 1900 for compatibility.
Source§fn build_lookup_index(
&self,
view: &RangeView<'_>,
axis: LookupAxis,
) -> Option<Arc<LookupIndex>>
fn build_lookup_index( &self, view: &RangeView<'_>, axis: LookupAxis, ) -> Option<Arc<LookupIndex>>
Optional: Build or fetch an exact-match lookup index over an Arrow-backed view.
Implementations should return None if not supported or unsafe.
Source§fn build_criteria_mask(
&self,
view: &RangeView<'_>,
col_in_view: usize,
pred: &CriteriaPredicate,
) -> Option<Arc<BooleanArray>>
fn build_criteria_mask( &self, view: &RangeView<'_>, col_in_view: usize, pred: &CriteriaPredicate, ) -> Option<Arc<BooleanArray>>
Optional: Build or fetch a cached boolean mask for a criterion over an Arrow-backed view.
Implementations should return None if not supported.
Source§fn build_row_visibility_mask(
&self,
view: &RangeView<'_>,
mode: VisibilityMaskMode,
) -> Option<Arc<BooleanArray>>
fn build_row_visibility_mask( &self, view: &RangeView<'_>, mode: VisibilityMaskMode, ) -> Option<Arc<BooleanArray>>
Optional: Build row-visibility mask aligned to
view rows.
Returns None if not supported by the underlying context.Source§impl<'a, R: EvaluationContext> FunctionProvider for RecordingContext<'a, R>
impl<'a, R: EvaluationContext> FunctionProvider for RecordingContext<'a, R>
Source§impl<'a, R: EvaluationContext> NamedRangeResolver for RecordingContext<'a, R>
impl<'a, R: EvaluationContext> NamedRangeResolver for RecordingContext<'a, R>
fn resolve_named_range_reference( &self, name: &str, ) -> Result<Vec<Vec<LiteralValue>>, ExcelError>
Source§impl<'a, R: EvaluationContext> RangeResolver for RecordingContext<'a, R>
impl<'a, R: EvaluationContext> RangeResolver for RecordingContext<'a, R>
Source§impl<'a, R: EvaluationContext> ReferenceResolver for RecordingContext<'a, R>
impl<'a, R: EvaluationContext> ReferenceResolver for RecordingContext<'a, R>
fn resolve_cell_reference( &self, sheet: Option<&str>, row: u32, col: u32, ) -> Result<LiteralValue, ExcelError>
Source§impl<'a, R: EvaluationContext> Resolver for RecordingContext<'a, R>
impl<'a, R: EvaluationContext> Resolver for RecordingContext<'a, R>
fn resolve_range_like( &self, r: &ReferenceType, ) -> Result<Box<dyn Range>, ExcelError>
Source§impl<'a, R: EvaluationContext> SourceResolver for RecordingContext<'a, R>
impl<'a, R: EvaluationContext> SourceResolver for RecordingContext<'a, R>
fn source_scalar_version(&self, name: &str) -> Option<u64>
fn resolve_source_scalar(&self, name: &str) -> Result<LiteralValue, ExcelError>
fn source_table_version(&self, name: &str) -> Option<u64>
fn resolve_source_table(&self, name: &str) -> Result<Box<dyn Table>, ExcelError>
Source§impl<'a, R: EvaluationContext> TableResolver for RecordingContext<'a, R>
impl<'a, R: EvaluationContext> TableResolver for RecordingContext<'a, R>
fn resolve_table_reference( &self, tref: &TableReference, ) -> Result<Box<dyn Table>, ExcelError>
Auto Trait Implementations§
impl<'a, R> !RefUnwindSafe for RecordingContext<'a, R>
impl<'a, R> !UnwindSafe for RecordingContext<'a, R>
impl<'a, R> Freeze for RecordingContext<'a, R>
impl<'a, R> Send for RecordingContext<'a, R>
impl<'a, R> Sync for RecordingContext<'a, R>
impl<'a, R> Unpin for RecordingContext<'a, R>
impl<'a, R> UnsafeUnpin for RecordingContext<'a, 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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