pub enum DataRef<'a> {
Int(i64),
Float(f64),
String(String),
SharedString(&'a str),
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
Shared String
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 DataRef<'_>
impl DataType for DataRef<'_>
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
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_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.impl<'a> CellType for DataRef<'a>
impl<'a> StructuralPartialEq for DataRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for DataRef<'a>
impl<'a> RefUnwindSafe for DataRef<'a>
impl<'a> Send for DataRef<'a>
impl<'a> Sync for DataRef<'a>
impl<'a> Unpin for DataRef<'a>
impl<'a> UnwindSafe for DataRef<'a>
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