Skip to main content

formualizer_sheetport/
location.rs

1use formualizer_common::RangeAddress;
2use sheetport_spec::{LayoutDescriptor, TableSelector};
3
4/// Location for scalar ports.
5#[derive(Debug, Clone)]
6pub enum ScalarLocation {
7    /// Single cell location (parsed from an A1 reference).
8    Cell(RangeAddress),
9    /// Workbook-defined name.
10    Name(String),
11    /// Structured reference (e.g., `Table[Column]`).
12    StructRef(String),
13}
14
15/// Location for ports that span an area (records or rectangular ranges).
16#[derive(Debug, Clone)]
17pub enum AreaLocation {
18    /// Explicit range address.
19    Range(RangeAddress),
20    /// Workbook-defined name resolving to an area.
21    Name(String),
22    /// Structured reference.
23    StructRef(String),
24    /// Layout descriptor for header-driven regions.
25    Layout(LayoutDescriptor),
26}
27
28/// Location options for table-shaped ports.
29#[derive(Debug, Clone)]
30pub enum TableLocation {
31    /// Reference to a workbook table.
32    Table(TableSelector),
33    /// Layout descriptor (implicit table).
34    Layout(LayoutDescriptor),
35}
36
37/// Location for record field cells.
38#[derive(Debug, Clone)]
39pub enum FieldLocation {
40    /// Explicit single-cell address.
41    Cell(RangeAddress),
42    /// Workbook-defined name.
43    Name(String),
44    /// Structured reference.
45    StructRef(String),
46}