pub struct CellRef {
pub sheet: String,
pub addr: Address,
}Expand description
A fully resolved cell coordinate: a sheet (by its position-independent,
case-folded name) and an in-bounds Address.
Sheets are keyed by folded name, not tab index, so the key survives a
sheet move (P3.1 move_sheet) and matches the case-insensitive sheet
lookup of Workbook::sheet. A rename changes the
key, which is why a rename forces a graph rebuild (see the module docs and
DependencyGraph::build).
Fields§
§sheet: StringThe target sheet’s name, simple-case-folded (schema spec §2).
addr: AddressThe in-bounds A1 address within that sheet.
Implementations§
Source§impl CellRef
impl CellRef
Sourcepub fn from_display_name(sheet: &str, addr: Address) -> Self
pub fn from_display_name(sheet: &str, addr: Address) -> Self
Builds the graph key for addr on the sheet named sheet, applying the
simple case folding (schema spec §2) the graph indexes sheets by.
Named from_display_name — not resolve — because it does not consult
a Workbook: it only folds the caller’s spelling
into the graph’s key form, the same way new builds a
CellRef from an already-folded one. resolve_ref and
resolve_query_cell elsewhere in this crate do look a sheet up
against a workbook; this does not, so it does not share their name.
The sheet field is public but holds a folded name, so
a CellRef constructed literally from a user-facing sheet name (a tab
label, a JSON key, an API argument) silently matches nothing in the
graph whenever that name is not already folded. Any sheet name that did
not come out of the graph itself should reach a query through here.
Folding is idempotent, so passing an already-folded name is a no-op. The sheet is not required to exist — an unknown sheet simply produces a key nothing in the graph matches.