Skip to main content

Module format

Module format 

Source
Expand description

Typed external formats for crate::Time.

A format marker specifies how a time instant is externally expressed. The built-in markers live in markers: Julian Day (JD), Modified Julian Day (MJD), J2000 seconds (J2000s), POSIX seconds (Unix), and GPS seconds (GPS). Format is orthogonal to scale: JulianDate<TT> and JulianDate<UTC> share the same format but live on different physical time axes, and the compiler treats them as distinct, incompatible types.

Instants are always crate::Time<S, F> with compensated J2000-second storage; F is a phantom encoding tag for raw(), conversions, and targets.

JulianDate<S>, ModifiedJulianDate<S>, UnixTime, and GpsTime implement Into into the default-tagged crate::Time instant on their scale (Time<S>, Time<UTC>, Time<TAI>), equivalent to Time::to_j2000s. crate::Interval::try_new therefore accepts encoded endpoints wherever Into<crate::Time<S>> is required (including crate::Period).

J2000Seconds<S> is a type alias for crate::Time<S>; prefer it when you want an explicit name for the default tag.

§Main types

Re-exports§

pub use markers::J2000s;
pub use markers::Unix;
pub use markers::GPS;
pub use markers::JD;
pub use markers::MJD;
pub use iso::FormatOptions;
pub use iso::FormatPrecision;
pub use gnss_week::GnssWeek;
pub use gnss_week::GnssWeekScale;

Modules§

gnss_week
GNSS week-number and seconds-of-week formatting for Time<S> on the supported continuous GNSS scales (GPST, GST, BDT, QZSST).
iso
ISO 8601 / RFC 3339 / RFC 2822 parsing and formatting for Time<UTC> and (via scale conversion) Time<TAI>.
markers
Built-in external time-format markers.

Traits§

FormatForScale
Witness that format F can encode and decode instants on scale S.
InfallibleFormatForScale
Witness that format F can encode scale S without a TimeContext.
TimeFormat
Marker trait for an external time encoding such as JD or Unix time.

Type Aliases§

GpsTime
GPS seconds on the TAI axis.
J2000Seconds
SI seconds since J2000.0 on scale S.
JulianDate
Julian day instant on scale S (JD tag).
ModifiedJulianDate
Modified Julian day instant on scale S.
UnixTime
POSIX / Unix seconds on the UTC axis.