Trait calamine::DataType

source ·
pub trait DataType {
    // 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 get_int(&self) -> Option<i64>;
    fn get_float(&self) -> Option<f64>;
    fn get_bool(&self) -> Option<bool>;
    fn get_string(&self) -> Option<&str>;
    fn as_string(&self) -> Option<String>;
    fn as_i64(&self) -> Option<i64>;
    fn as_f64(&self) -> Option<f64>;
}
Expand description

A trait to represent all different data types that can appear as a value in a worksheet cell

Required Methods§

source

fn is_empty(&self) -> bool

Assess if datatype is empty

source

fn is_int(&self) -> bool

Assess if datatype is a int

source

fn is_float(&self) -> bool

Assess if datatype is a float

source

fn is_bool(&self) -> bool

Assess if datatype is a bool

source

fn is_string(&self) -> bool

Assess if datatype is a string

source

fn get_int(&self) -> Option<i64>

Try getting int value

source

fn get_float(&self) -> Option<f64>

Try getting float value

source

fn get_bool(&self) -> Option<bool>

Try getting bool value

source

fn get_string(&self) -> Option<&str>

Try getting string value

source

fn as_string(&self) -> Option<String>

Try converting data type into a string

source

fn as_i64(&self) -> Option<i64>

Try converting data type into an int

source

fn as_f64(&self) -> Option<f64>

Try converting data type into a float

Implementors§

source§

impl DataType for Data

An enum to represent all different data types that can appear as a value in a worksheet cell

source§

impl DataType for DataRef<'_>