pub enum DataType {
Int(i64),
Float(f64),
String(String),
Bool(bool),
DateTime(f64),
Duration(f64),
DateTimeIso(String),
DurationIso(String),
Error(CellErrorType),
Empty,
}
Expand description
An enum to represent all different data types that can appear as a value in a worksheet cell
Variants§
Int(i64)
Signed integer
Float(f64)
Float
String(String)
String
Bool(bool)
Boolean
DateTime(f64)
Date or Time
Duration(f64)
Duration
DateTimeIso(String)
Date, Time or DateTime in ISO 8601
DurationIso(String)
Duration in ISO 8601
Error(CellErrorType)
Error
Empty
Empty cell
Implementations§
Source§impl DataType
impl DataType
Sourcepub fn get_string(&self) -> Option<&str>
pub fn get_string(&self) -> Option<&str>
Try getting string value
Sourcepub fn as_duration(&self) -> Option<Duration>
pub fn as_duration(&self) -> Option<Duration>
Try converting data type into a duration
Sourcepub fn as_datetime(&self) -> Option<NaiveDateTime>
pub fn as_datetime(&self) -> Option<NaiveDateTime>
Try converting data type into a datetime
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DataType
impl<'de> Deserialize<'de> for DataType
Source§fn deserialize<D>(deserializer: D) -> Result<DataType, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<DataType, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CellErrorType> for DataType
impl From<CellErrorType> for DataType
Source§fn from(v: CellErrorType) -> Self
fn from(v: CellErrorType) -> Self
Converts to this type from the input type.
Source§impl<'a> ToCellDeserializer<'a> for DataType
impl<'a> ToCellDeserializer<'a> for DataType
impl CellType for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
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