Skip to main content

Data

Type Alias Data 

Source
pub type Data = Cell;
Expand description

Calamine-style data value name for generic read-side code.

rxls keeps Cell as the concrete value model so formula cells can preserve both source text and cached values. Data is a compatibility alias rather than a second enum, so Range and Sheet accessors continue to return the same borrowed values.

Aliased Type§

pub enum Data {
    Text(String),
    Number(f64),
    Date(f64),
    Bool(bool),
    Error(String),
    Formula {
        formula: String,
        cached: Box<Cell>,
    },
}

Variants§

§

Text(String)

Text (shared-string or inline-string) cell.

§

Number(f64)

Numeric cell — the raw value (a percentage keeps its fraction, e.g. 0.5).

§

Date(f64)

Date / time / datetime cell — the raw Excel serial (e.g. 45366.0), preserving the full value incl. time-of-day (like calamine). Use the workbook’s date system to convert, or Sheet::to_text for the Excel-formatted string.

§

Bool(bool)

Boolean cell.

§

Error(String)

Error cell (#DIV/0!, #N/A, …).

§

Formula

A formula cell — the formula text (without the leading =) plus its last cached value. The reader produces the cached value directly; this variant is for authoring a formula via Sheet::write.

Fields

§formula: String

Formula text, e.g. SUM(A1:A9).

§cached: Box<Cell>

The last cached result value.