pub trait DataType {
Show 24 methods
// Required methods
fn is_empty(&self) -> bool;
fn is_int(&self) -> bool;
fn is_float(&self) -> bool;
fn is_bool(&self) -> bool;
fn is_string(&self) -> bool;
fn is_error(&self) -> bool;
fn is_duration_iso(&self) -> bool;
fn is_datetime(&self) -> bool;
fn is_datetime_iso(&self) -> bool;
fn get_int(&self) -> Option<i64>;
fn get_float(&self) -> Option<f64>;
fn get_bool(&self) -> Option<bool>;
fn get_string(&self) -> Option<&str>;
fn get_datetime(&self) -> Option<ExcelDateTime>;
fn get_datetime_iso(&self) -> Option<&str>;
fn get_duration_iso(&self) -> Option<&str>;
fn get_error(&self) -> Option<&CellErrorType>;
fn as_string(&self) -> Option<String>;
fn as_i64(&self) -> Option<i64>;
fn as_f64(&self) -> Option<f64>;
// Provided methods
fn as_date(&self) -> Option<NaiveDate> { ... }
fn as_time(&self) -> Option<NaiveTime> { ... }
fn as_duration(&self) -> Option<Duration> { ... }
fn as_datetime(&self) -> Option<NaiveDateTime> { ... }
}Expand description
A trait to represent all different data types that can appear as a value in a worksheet cell
Required Methods§
Sourcefn is_duration_iso(&self) -> bool
fn is_duration_iso(&self) -> bool
Assess if datatype is an ISO8601 duration
Sourcefn is_datetime(&self) -> bool
fn is_datetime(&self) -> bool
Assess if datatype is a datetime
Sourcefn is_datetime_iso(&self) -> bool
fn is_datetime_iso(&self) -> bool
Assess if datatype is an ISO8601 datetime
Sourcefn get_string(&self) -> Option<&str>
fn get_string(&self) -> Option<&str>
Try getting string value
Sourcefn get_datetime(&self) -> Option<ExcelDateTime>
fn get_datetime(&self) -> Option<ExcelDateTime>
Try getting datetime value
Sourcefn get_datetime_iso(&self) -> Option<&str>
fn get_datetime_iso(&self) -> Option<&str>
Try getting datetime ISO8601 value
Sourcefn get_duration_iso(&self) -> Option<&str>
fn get_duration_iso(&self) -> Option<&str>
Try getting duration ISO8601 value
Sourcefn get_error(&self) -> Option<&CellErrorType>
fn get_error(&self) -> Option<&CellErrorType>
Try getting Error value
Provided Methods§
Sourcefn as_date(&self) -> Option<NaiveDate>
Available on crate feature chrono only.
fn as_date(&self) -> Option<NaiveDate>
chrono only.Try converting data type into a date
Sourcefn as_time(&self) -> Option<NaiveTime>
Available on crate feature chrono only.
fn as_time(&self) -> Option<NaiveTime>
chrono only.Try converting data type into a time
Sourcefn as_duration(&self) -> Option<Duration>
Available on crate feature chrono only.
fn as_duration(&self) -> Option<Duration>
chrono only.Try converting data type into a duration
fn as_datetime(&self) -> Option<NaiveDateTime>
Available on crate feature
chrono only.