[][src]Struct ion_c_sys::_ion_timestamp

#[repr(C)]pub struct _ion_timestamp {
    pub precision: u8,
    pub tz_offset: i16,
    pub year: u16,
    pub month: u16,
    pub day: u16,
    pub hours: u16,
    pub minutes: u16,
    pub seconds: u16,
    pub fraction: decQuad,
}

Structure to store time information. time_t only has up to second precision, and time zone support is OS dependent. _ion_timestamp uses decimal to store fraction of a second

Fields

precision: u8

Defined as ION_TS_YEAR, ION_TS_MONTH, ION_TS_DAY, ION_TS_MIN, ION_TS_SEC, ION_TS_FRAC

tz_offset: i16

Time zone offset (+/- 24 hours), in term of minutes.

year: u16month: u16day: u16hours: u16minutes: u16seconds: u16fraction: decQuad

Fraction of a second, e.g: 0.5, 0.01, etc

Implementations

impl _ion_timestamp[src]

pub fn try_assign_from_iondt(&mut self, ion_dt: &IonDateTime) -> IonCResult<()>[src]

Converts the given IonDateTime into this ION_TIMESTAMP.

pub fn try_to_iondt(&mut self) -> IonCResult<IonDateTime>[src]

Converts this ION_TIMESTAMP into a IonDateTime.

Note that this borrows mutably, because all of the underlying ion_timestamp_* functions require a mutable pointer, but this operation does not actually change the value.

Trait Implementations

impl Clone for _ion_timestamp[src]

impl Copy for _ion_timestamp[src]

impl Default for _ion_timestamp[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.