pub enum LiteralValue {
Int(i64),
Number(f64),
Text(String),
Boolean(bool),
Array(Vec<Vec<LiteralValue>>),
Date(NaiveDate),
DateTime(NaiveDateTime),
Time(NaiveTime),
Duration(TimeDelta),
Empty,
Pending,
Error(ExcelError),
}Expand description
An interpeter LiteralValue. This is distinct from the possible types that can be stored in a cell.
Variants§
Int(i64)
Number(f64)
Text(String)
Boolean(bool)
Array(Vec<Vec<LiteralValue>>)
Date(NaiveDate)
DateTime(NaiveDateTime)
Time(NaiveTime)
Duration(TimeDelta)
Empty
Pending
Error(ExcelError)
Implementations§
Source§impl LiteralValue
impl LiteralValue
Sourcepub fn coerce_to_single_value(&self) -> Result<LiteralValue, ValueError>
pub fn coerce_to_single_value(&self) -> Result<LiteralValue, ValueError>
Coerce
Sourcepub fn as_serial_number_for(&self, system: DateSystem) -> Option<f64>
pub fn as_serial_number_for(&self, system: DateSystem) -> Option<f64>
Convert this value to a serial number in the selected date system.
Sourcepub fn as_serial_number(&self) -> Option<f64>
pub fn as_serial_number(&self) -> Option<f64>
Compatibility wrapper using the historical implicit Excel-1900 system.
Sourcepub fn try_from_serial_number_for(
system: DateSystem,
serial: f64,
) -> Result<LiteralValue, ExcelError>
pub fn try_from_serial_number_for( system: DateSystem, serial: f64, ) -> Result<LiteralValue, ExcelError>
Build the appropriate temporal value from an Excel serial number.
This conversion uses representable chrono calendar values. In the
Excel-1900 system, phantom serial 60 therefore becomes 1900-02-28 and
re-encodes as serial 59. Use the display-parts API when the fictitious
1900-02-29 must remain distinguishable.
Sourcepub fn try_from_serial_number(serial: f64) -> Result<LiteralValue, ExcelError>
pub fn try_from_serial_number(serial: f64) -> Result<LiteralValue, ExcelError>
Checked convenience wrapper using the implicit Excel-1900 system.
Sourcepub fn from_serial_number(serial: f64) -> LiteralValue
pub fn from_serial_number(serial: f64) -> LiteralValue
Compatibility wrapper using the historical implicit Excel-1900 system.
Inputs outside Excel’s calendar domain retain the legacy common
behavior. New code should use Self::try_from_serial_number or
Self::try_from_serial_number_for for checked conversion.
pub fn is_truthy(&self) -> bool
Trait Implementations§
Source§impl Clone for LiteralValue
impl Clone for LiteralValue
Source§fn clone(&self) -> LiteralValue
fn clone(&self) -> LiteralValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more