pub struct DataColumn {
pub id: u64,
pub name: String,
pub width: Option<f64>,
/* private fields */
}Expand description
One column of a sheet: the raw text, the computed values, the cell types, the compiled formulas and the styles, as parallel per-row vectors.
§Invariant
src, data, cell_types, compiled_src and styles must all stay the
same length – row r of the column is entry r of each. Nothing
enforces this; the row and column insert/delete paths in Sheet maintain it
by hand, and Sheet::setup_after_deserialization restores it after a load,
since only src and styles are persisted. Mutating one of these vectors
directly will break it.
dirty_indices is not part of that invariant – it is a queue of rows
awaiting recomputation, and is emptied by Sheet::commit.
Fields§
§id: u64Identifier, stable across renames and repositioning. Compiled formulas refer to a column by this rather than by name or position.
name: StringDisplay name, empty unless one was set.
width: Option<f64>[AI-Agent] Excel/OpenXML column width in character units, when one was explicitly stored.
Implementations§
Source§impl DataColumn
impl DataColumn
Sourcepub fn new(size: usize) -> Self
pub fn new(size: usize) -> Self
A column of size empty rows, with every parallel vector sized to
match and a freshly generated id.
Sourcepub fn src(&self, row: usize) -> Option<&str>
pub fn src(&self, row: usize) -> Option<&str>
The raw text of a cell, exactly as typed, or None past the end.
Sourcepub fn value(&self, row: usize) -> Option<ResultData>
pub fn value(&self, row: usize) -> Option<ResultData>
The computed value of a cell, or None past the end.
Reflects the last Sheet::commit; a cell edited since then still
reads as its old value.
Sourcepub fn values(&self) -> &ColumnData
pub fn values(&self) -> &ColumnData
The whole value column, for callers that want to work with the typed representation rather than row by row.
Sourcepub fn cell_type(&self, row: usize) -> Option<CellType>
pub fn cell_type(&self, row: usize) -> Option<CellType>
The intrinsic data type of a cell, or None past the end.
Sourcepub fn set_cell_type(&mut self, row: usize, cell_type: CellType)
pub fn set_cell_type(&mut self, row: usize, cell_type: CellType)
Sets the intrinsic data type of a cell at row.
Sourcepub fn compiled(&self, row: usize) -> Option<&CompiledFormula>
pub fn compiled(&self, row: usize) -> Option<&CompiledFormula>
A cell’s compiled formula, or None past the end. A cell holding a
literal has an empty one rather than no entry.
Trait Implementations§
Source§impl Clone for DataColumn
impl Clone for DataColumn
Source§fn clone(&self) -> DataColumn
fn clone(&self) -> DataColumn
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more