Skip to main content

TimeFormat

Trait TimeFormat 

Source
pub trait TimeFormat:
    Sealed
    + Copy
    + Clone
    + Debug
    + 'static {
    type Unit: Unit;

    const NAME: &'static str;
}
Expand description

Marker trait for an external time encoding such as JD or Unix time.

A TimeFormat value is a zero-sized tag that identifies how a time instant is expressed (Julian Day, Modified Julian Day, J2000 seconds, POSIX seconds, GPS seconds). It is orthogonal to Scale, which identifies the physical time axis.

Sealed: implementations live in this crate only.

Required Associated Constants§

Source

const NAME: &'static str

Human-readable format name.

Required Associated Types§

Source

type Unit: Unit

Quantity unit used by this format.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl TimeFormat for GPS

Source§

const NAME: &'static str = "GPS"

Source§

type Unit = Second

Source§

impl TimeFormat for J2000s

Source§

const NAME: &'static str = "J2000s"

Source§

type Unit = Second

Source§

impl TimeFormat for JD

Source§

const NAME: &'static str = "JD"

Source§

type Unit = Day

Source§

impl TimeFormat for MJD

Source§

const NAME: &'static str = "MJD"

Source§

type Unit = Day

Source§

impl TimeFormat for Unix

Source§

const NAME: &'static str = "Unix"

Source§

type Unit = Second