Skip to main content

TimeFormat

Enum TimeFormat 

Source
#[repr(i32)]
pub enum TimeFormat {
Show 23 variants Iso = 0, Yday = 1, Byear = 2, Jyear = 3, DecimalYear = 4, Jd = 5, Mjd = 6, Gps = 7, Unix = 8, Utime = 9, TaiSeconds = 10, Cxcsec = 11, Galexsec = 12, UnixTai = 13, Reserved1 = 14, ByearStr = 15, Datetime = 16, Fits = 17, Isot = 18, JyearStr = 19, PlotDate = 20, Ymdhms = 21, Datetime64 = 22,
}
Expand description

How a time is written, mirroring asdf_time_format_t.

The discriminants are part of the C ABI.

Variants§

§

Iso = 0

ISO 8601 date and time, the default.

§

Yday = 1

Year, day-of-year and time.

§

Byear = 2

Besselian epoch year.

§

Jyear = 3

Julian epoch year.

§

DecimalYear = 4

Decimal year.

§

Jd = 5

Julian Date.

§

Mjd = 6

Modified Julian Date.

§

Gps = 7

Seconds from the GPS epoch.

§

Unix = 8

Seconds from the Unix epoch, ignoring leap seconds.

§

Utime = 9

UT seconds from 1979-01-01.

§

TaiSeconds = 10

SI seconds from 1958-01-01, including leap seconds.

§

Cxcsec = 11

Chandra X-ray Center seconds from 1998-01-01 TT.

§

Galexsec = 12

GALEX seconds from 1980-01-06.

§

UnixTai = 13

SI seconds from 1970-01-01 TAI.

§

Reserved1 = 14

Reserved; not a usable format.

§

ByearStr = 15

Besselian epoch in string form.

§

Datetime = 16

A Python datetime.datetime.

§

Fits = 17

FITS date-time string.

§

Isot = 18

ISO 8601 with a literal T separator.

§

JyearStr = 19

Julian epoch in string form.

§

PlotDate = 20

matplotlib ordinal days.

§

Ymdhms = 21

Year/month/day/hour/minute/second fields.

§

Datetime64 = 22

NumPy datetime64.

Implementations§

Source§

impl TimeFormat

Source

pub fn name(self) -> Option<&'static str>

The name written to a file, or None for the reserved slot.

Source

pub fn from_name(name: &str) -> Option<Self>

Parse a format name.

Source

pub fn standard(self) -> Self

The format written to the wire format field.

The schema only permits a subset there; an “other” format maps to the standard one it is a spelling of, and goes in base_format instead.

Source

pub fn is_other(self) -> bool

Whether this format may appear only in base_format.

Trait Implementations§

Source§

impl Clone for TimeFormat

Source§

fn clone(&self) -> TimeFormat

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for TimeFormat

Source§

impl Debug for TimeFormat

Source§

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

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

impl Default for TimeFormat

Source§

fn default() -> TimeFormat

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

impl Eq for TimeFormat

Source§

impl PartialEq for TimeFormat

Source§

fn eq(&self, other: &TimeFormat) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TimeFormat

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.