#[non_exhaustive]pub enum Value {
Null,
Bool(bool),
Integer(i64),
Float(f64),
Date(String),
DateTime(String),
Text(String),
}Expand description
One cell value. Keep the variants narrow — anything richer
(decimals with arbitrary precision, embedded formulas, currency
types) degrades to Text so callers don’t have to handle a
combinatorial explosion of types. Round-trips cleanly through
serde_json::Value for any caller that adds serde.
#[non_exhaustive] so we can grow the enum (a future
Decimal variant, for instance) without breaking external
matches. Always include a wildcard arm when matching.
Date / DateTime payloads are ISO-8601 strings. v0.3
surfaces dates as their canonical text representation rather
than carrying a chrono dependency in the public API; callers
that need typed dates parse the string with chrono::NaiveDate::parse_from_str
(or equivalent). A future dates feature could carry typed
values alongside the strings, but the contract here is stable:
Value::Date(s) always means s parses as ISO-8601
YYYY-MM-DD; Value::DateTime(s) means
YYYY-MM-DDTHH:MM:SS[.fff][±HH:MM|Z].
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Null
Empty / missing cell.
Bool(bool)
Truthy / falsy cell.
Integer(i64)
Whole number.
Float(f64)
Decimal / floating-point.
Date(String)
ISO-8601 calendar date, YYYY-MM-DD.
DateTime(String)
ISO-8601 date + time. Format may include sub-second precision and a timezone designator.
Text(String)
Anything else: mixed-type cells, formula results, decimals
outside f64 precision, currency strings, etc. Caller
decides how to parse further.