pub enum Data {
Int(i64),
Float(f64),
String(String),
RichText(RichText),
Bool(bool),
DateTime(ExcelDateTime),
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
RichText(RichText)
Rich text with multiple formatted runs
Bool(bool)
Boolean
DateTime(ExcelDateTime)
Date or Time
DateTimeIso(String)
Date, Time or Date/Time in ISO 8601
DurationIso(String)
Duration in ISO 8601
Error(CellErrorType)
Error
Empty
Empty cell
Trait Implementations§
Source§impl DataType for Data
An enum to represent all different data types that can appear as
a value in a worksheet cell
impl DataType for Data
An enum to represent all different data types that can appear as a value in a worksheet cell
Source§fn is_rich_text(&self) -> bool
fn is_rich_text(&self) -> bool
Assess if datatype is rich text (string with formatting)
Source§fn is_duration_iso(&self) -> bool
fn is_duration_iso(&self) -> bool
Assess if datatype is an ISO8601 duration
Source§fn is_datetime(&self) -> bool
fn is_datetime(&self) -> bool
Assess if datatype is a datetime
Source§fn is_datetime_iso(&self) -> bool
fn is_datetime_iso(&self) -> bool
Assess if datatype is an ISO8601 datetime
Source§fn get_string(&self) -> Option<&str>
fn get_string(&self) -> Option<&str>
Try getting string value (plain string only, not rich text)
Source§fn get_rich_text(&self) -> Option<&RichText>
fn get_rich_text(&self) -> Option<&RichText>
Try getting rich text value
Source§fn get_datetime(&self) -> Option<ExcelDateTime>
fn get_datetime(&self) -> Option<ExcelDateTime>
Try getting datetime value
Source§fn get_datetime_iso(&self) -> Option<&str>
fn get_datetime_iso(&self) -> Option<&str>
Try getting datetime ISO8601 value
Source§fn get_duration_iso(&self) -> Option<&str>
fn get_duration_iso(&self) -> Option<&str>
Try getting duration ISO8601 value
Source§fn get_error(&self) -> Option<&CellErrorType>
fn get_error(&self) -> Option<&CellErrorType>
Try getting Error value
Source§fn as_string(&self) -> Option<String>
fn as_string(&self) -> Option<String>
Try converting data type into a string (includes rich text as plain text)
Source§fn as_date(&self) -> Option<NaiveDate>
fn as_date(&self) -> Option<NaiveDate>
Available on crate feature
chrono only.Try converting data type into a date
Source§fn as_time(&self) -> Option<NaiveTime>
fn as_time(&self) -> Option<NaiveTime>
Available on crate feature
chrono only.Try converting data type into a time
Source§fn as_duration(&self) -> Option<Duration>
fn as_duration(&self) -> Option<Duration>
Available on crate feature
chrono only.Try converting data type into a duration
Source§fn as_datetime(&self) -> Option<NaiveDateTime>
fn as_datetime(&self) -> Option<NaiveDateTime>
Available on crate feature
chrono only.Source§impl<'de> Deserialize<'de> for Data
impl<'de> Deserialize<'de> for Data
Source§fn deserialize<D>(deserializer: D) -> Result<Data, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Data, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CellErrorType> for Data
impl From<CellErrorType> for Data
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 Data
impl<'a> ToCellDeserializer<'a> for Data
impl CellType for Data
impl StructuralPartialEq for Data
Auto Trait Implementations§
impl Freeze for Data
impl RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnsafeUnpin for Data
impl UnwindSafe for Data
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