pub struct Cell { /* private fields */ }Expand description
An authored cell: a literal (value only) or a formula
(formula + value). Schema spec §4.
value is required on every cell, including formula cells — a
never-evaluated formula cell carries Value::Empty until first recalc.
A formula-less cell whose value is empty is invalid; construction and
deserialization both reject it (see Cell::literal).
Implementations§
Source§impl Cell
impl Cell
Sourcepub fn literal(value: Value) -> Result<Self, WorkbookError>
pub fn literal(value: Value) -> Result<Self, WorkbookError>
Creates a literal cell.
Rejects Value::Empty: an empty literal would be
byte-distinguishable from the absent cell it denotes (schema spec §4).
Clear a cell by removing its entry from the sheet’s cell map instead.
Sourcepub fn with_formula(formula: impl Into<String>, value: Value) -> Self
pub fn with_formula(formula: impl Into<String>, value: Value) -> Self
Creates a formula cell.
formula is the verbatim authored text including the leading = —
it is never normalized and round-trips byte-exact. value is the
most recent evaluated result (Value::Empty until first recalc).