pub enum LiteralValue {
Int(i64),
Number(f64),
Text(String),
Boolean(bool),
Array(Vec<Vec<LiteralValue>>),
Date(NaiveDate),
DateTime(NaiveDateTime),
Time(NaiveTime),
Duration(Duration),
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(Duration)
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
pub fn as_serial_number(&self) -> Option<f64>
Sourcepub fn from_serial_number(serial: f64) -> Self
pub fn from_serial_number(serial: f64) -> Self
Build the appropriate LiteralValue from an Excel serial number.
(Useful when a function returns a date/time).
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LiteralValue
impl Debug for LiteralValue
Source§impl Display for LiteralValue
impl Display for LiteralValue
Source§impl From<ExcelError> for LiteralValue
impl From<ExcelError> for LiteralValue
Source§fn from(error: ExcelError) -> Self
fn from(error: ExcelError) -> Self
Converts to this type from the input type.
Source§impl Hash for LiteralValue
impl Hash for LiteralValue
Source§impl PartialEq for LiteralValue
impl PartialEq for LiteralValue
impl Eq for LiteralValue
impl StructuralPartialEq for LiteralValue
Auto Trait Implementations§
impl Freeze for LiteralValue
impl RefUnwindSafe for LiteralValue
impl Send for LiteralValue
impl Sync for LiteralValue
impl Unpin for LiteralValue
impl UnwindSafe for LiteralValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more