Enum omf::data::Numbers

source ·
pub enum Numbers {
    F32(GenericNumbers<f32>),
    F64(GenericNumbers<f64>),
    I64(GenericNumbers<i64>),
    Date(GenericNumbers<NaiveDate>),
    DateTime(GenericNumbers<DateTime<Utc>>),
}
Expand description

Iterator for reading number data of various types.

You can access the variants directly or use the try_into_f64 and try_into_i64 methods. These methods can both fail so aren’t automatic.

Variants§

Implementations§

source§

impl Numbers

source

pub fn try_into_f64(self) -> Result<NumbersF64, Error>

Turns this into an f64 iterator, casting values.

If the numbers use type i64 this will fail with Error::UnsafeCast. Dates will become days since the ‘1970-01-01’ epoch. Date-times will become seconds since the ‘1970-01-01T00:00:00Z’ epoch with a small loss of precision.

Currently can’t fail but future number types might yield Error::UnsafeCast.

source

pub fn try_into_i64(self) -> Result<NumbersI64, Error>

Turns this into an i64 iterator, casting values.

Floating-point types will be rejected with Error::UnsafeCast. Dates will become days since the ‘1970-01-01’ epoch. Date-times will become microseconds since the ‘1970-01-01T00:00:00Z’ epoch.

Trait Implementations§

source§

impl Debug for Numbers

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Numbers

§

impl !RefUnwindSafe for Numbers

§

impl Send for Numbers

§

impl !Sync for Numbers

§

impl Unpin for Numbers

§

impl !UnwindSafe for Numbers

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, U> TryFrom<U> for T
where U: Into<T>,

source§

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>,

source§

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.