Expand description
Spreadsheet engine API.
Structs§
- AST
- Compiled AST (abstract syntax tree) of a Rhai script.
- Cell
- A cell in the spreadsheet grid.
- CellRef
- A reference to a cell by row and column indices (0-indexed).
- Dynamic
- Dynamic type containing any value.
Enums§
- Cell
Type - The type of content stored in a cell.
- Shift
Operation - Operation for shifting cell references in formulas
Functions§
- create_
engine - Create a Rhai engine with built-ins registered.
- create_
engine_ with_ functions - Create a Rhai engine with built-ins registered. Optionally compiles custom functions from the provided script. Returns the engine, compiled AST (if any), and any error message.
- create_
engine_ with_ functions_ and_ spill - Create a Rhai engine with built-ins, custom functions, and a shared spill map. Returns the engine, compiled AST (if any), and any error message.
- create_
engine_ with_ spill - Create a Rhai engine with built-ins registered and a shared spill map.
- detect_
cycle - Detect circular dependencies starting from a cell. Returns Some(cycle_path) if a cycle is found, None otherwise.
- eval_
with_ functions - Evaluate a formula, optionally with custom functions AST.
- extract_
dependencies - Extract all cell references from a script as dependencies.
- format_
dynamic - Format a Dynamic value for display.
- format_
number - Format a number for display.
- parse_
range - Parse a cell range like “A1:B5” and return (start_row, start_col, end_row, end_col).
- preprocess_
script - Replace cell references like “A1” with Rhai function calls like “cell(0, 0)”. Typed refs like “@A1” become “value(0, 0)” (returns Dynamic). Also transforms range functions like SUM(A1:B5, …) into sum_range(0, 0, 4, 1, …).
- shift_
formula_ references - Shift cell references in a formula when rows/cols are inserted/deleted. Returns the updated formula string.