Enum calamine::DataRef

source ·
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

§

SharedString(&'a str)

Shared String

§

Bool(bool)

Boolean

§

DateTime(ExcelDateTime)

Date or Time

§

DateTimeIso(String)

Date, Time or DateTime in ISO 8601

§

DurationIso(String)

Duration in ISO 8601

§

Error(CellErrorType)

Error

§

Empty

Empty cell

Trait Implementations§

source§

impl<'a> Clone for DataRef<'a>

source§

fn clone(&self) -> DataRef<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl DataType for DataRef<'_>

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
source§

impl<'a> Debug for DataRef<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for DataRef<'a>

source§

fn default() -> DataRef<'a>

Returns the “default value” for a type. Read more
source§

impl<'a> From<DataRef<'a>> for Data

source§

fn from(value: DataRef<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> PartialEq for DataRef<'a>

source§

fn eq(&self, other: &DataRef<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> CellType for DataRef<'a>

source§

impl<'a> StructuralPartialEq for DataRef<'a>

Auto Trait Implementations§

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.