calamine

Trait DataType

Source
pub trait DataType {
Show 14 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 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_error(&self) -> Option<&CellErrorType>; 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 is_error(&self) -> bool

Assess if datatype is a CellErrorType

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 get_error(&self) -> Option<&CellErrorType>

Try getting Error 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<'_>