pub struct Worksheet { /* private fields */ }Expand description
A named sheet holding a sparse cell grid (schema spec §3).
Cell keys are plain uppercase A1 addresses (A1, BC42) — no $, no
sheet qualifier, no lowercase. Absent addresses are empty cells and are
never serialized. The map is ordered (BTreeMap), which matches the
canonical (JCS) key order for ASCII A1 addresses: A10 sorts before A2.
The typed grid API (get / set /
clear, keyed by a bounds-validated Address) is the
in-memory accessor used by the recalc runtime (plan item 3.1); the raw
cells map is retained for the serde layer. Address-syntax
and sheet-name validation against the schema’s normative rules also happens
at the serialization boundary (Workbook::from_json),
independently of the typed API, since from_json parses untrusted keys.
Implementations§
Source§impl Worksheet
impl Worksheet
Sourcepub fn cells(&self) -> &BTreeMap<String, Cell>
pub fn cells(&self) -> &BTreeMap<String, Cell>
The sparse cell grid, keyed by plain uppercase A1 address.
Sourcepub fn cells_mut(&mut self) -> &mut BTreeMap<String, Cell>
pub fn cells_mut(&mut self) -> &mut BTreeMap<String, Cell>
Mutable access to the sparse cell grid.
Sourcepub fn get(&self, addr: Address) -> Option<&Cell>
pub fn get(&self, addr: Address) -> Option<&Cell>
The cell at addr, or None if that address is empty.
Sourcepub fn get_mut(&mut self, addr: Address) -> Option<&mut Cell>
pub fn get_mut(&mut self, addr: Address) -> Option<&mut Cell>
Mutable access to the cell at addr, or None if that address is empty.
Sourcepub fn set(&mut self, addr: Address, cell: Cell) -> Option<Cell>
pub fn set(&mut self, addr: Address, cell: Cell) -> Option<Cell>
Writes cell at addr, returning the cell previously there (if any).
addr is already bounds-validated by construction, so a set never
escapes the address bounds. To clear a cell use clear,
never a set of an empty value (schema spec §4).