v0.1.0
Release v0.1.0 — Type‑safe GNSS time core
gnss-time is a zero‑cost, no_std‑friendly Rust library for working with time in satellite navigation systems (GPS, GLONASS, Galileo, BeiDou, TAI, UTC).
What's included
Core types
Duration– signed nanosecond interval (i64) with arithmetic, saturating ops, andDisplay.Time<S>– parametric timestamp (u64) representing nanoseconds since the scale’s epoch.TimeScalesealed trait – markers forGps,Glonass,Galileo,Beidou,Tai,Utc.
Time scales & epochs
- Epoch constants:
GPS_EPOCH,GLONASS_EPOCH,GALILEO_EPOCH,BEIDOU_EPOCH,TAI_EPOCH,UNIX_EPOCH. CivilDatewithconstcalendar arithmetic.- Compile‑time verified offsets between epochs (days, seconds, nanoseconds).
- GPS:
Time<Gps>::from_week_tow(week, tow_s)+ accessorsweek(),tow_seconds(),sub_second_nanos(). - GLONASS:
Time<Glonass>::from_day_tod(day, tod_s)+ accessorsday(),tod_seconds().
Leap seconds (contextual conversions)
LeapSeconds– static built‑in table (19 entries, 1980–2017).LeapSecondsProvidertrait for custom / runtime sources.- Conversions:
gps_to_utc,utc_to_gps,glonass_to_utc,utc_to_glonass,gps_to_glonass,glonass_to_gps. - Tests for leap second boundaries (1998-12-31, 2016-12-31).
Display formatting
WeekTow(GPS/Galileo/BeiDou):"GPS 2345:432000.000"DayTod(GLONASS):"GLO 10512:43200.000"Simple(TAI/UTC):"TAI +1000000000s 0ns"
Error handling
GnssTimeErrorwithOverflow,InvalidInput,LeapSecondsRequired.
Examples
basic_usage,gps_week_tow,glonass_day_tod,scale_conversion,display_formats, and more.
Documentation & metadata
README.md,CHANGELOG.md,#![deny(missing_docs)].no_stdby default, optionalstdfeature.- All types are 8 bytes,
repr(transparent)– zero overhead.
Full Changelog: CHANGELOG.md