pub enum Ref {
Cell {
sheet: Option<String>,
addr: CellAddr,
},
Range {
sheet: Option<String>,
start: CellAddr,
end: CellAddr,
},
Name(String),
}Expand description
A parsed reference. Resolution (what the reference evaluates to) is delegated to the embedding application; see the workbook v1 scope ADR.
Variants§
Cell
A single cell, optionally sheet-qualified: A1, Sheet1!A1, 'Q2 Data'!A1.
Fields
Range
A rectangular range, optionally sheet-qualified: A1:D4, Sheet1!A1:B2.
Fields
Name(String)
A named reference (named range, defined name): TAX_RATE.
Implementations§
Source§impl Ref
impl Ref
Sourcepub fn classify(text: &str) -> Ref
pub fn classify(text: &str) -> Ref
Classify a bare identifier or range string into a Ref.
"A1" → Ref::Cell (no sheet), "A1:D4" → Ref::Range (no sheet),
anything else → Ref::Name. This is the mapping used for bare
identifiers in formulas, which stay crate::Expr::Variable nodes in
the AST for compatibility.
Sourcepub fn relative_display(&self) -> String
pub fn relative_display(&self) -> String
Canonical text with all $ anchors stripped — an identity/lookup key
where $ must not affect equality (e.g. resolver-override lookups,
dependency-graph dedup). Built structurally (zeroing col_abs/
row_abs before formatting), not by string-replacing $ out of the
rendered text, so a quoted sheet name that legitimately contains a
literal $ is not corrupted.