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
TimeFormat— sealed marker trait (JD,MJD, …).FormatForScale<S>— witness that formatFcan encode scaleS.InfallibleFormatForScale<S>— witness that the round-trip is context-free (except where the format itself requires a context, e.g. Unix).
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§
- Format
ForScale - Witness that format
Fcan encode and decode instants on scaleS. - Infallible
Format ForScale - Witness that format
Fcan encode scaleSwithout aTimeContext. - Time
Format - Marker trait for an external time encoding such as JD or Unix time.
Type Aliases§
- GpsTime
- GPS seconds on the TAI axis.
- J2000
Seconds - SI seconds since J2000.0 on scale
S. - Julian
Date - Julian day instant on scale
S(JDtag). - Modified
Julian Date - Modified Julian day instant on scale
S. - Unix
Time - POSIX / Unix seconds on the UTC axis.