Releases: MiCkEyZzZ/gnss-time
v0.5.3
Added
- Introduced
CivilDateTime— a proleptic Gregorian UTC datetime representation derived fromTime<Utc>. - Added bidirectional conversion API between
Time<Utc>andCivilDateTime. - Added
Displayimplementation for ISO 8601 / RFC 3339 format with nanosecond precision. - Added
is_whole_second()helper. - Added Unix time conversion API for
Time<Utc>(seconds and nanoseconds). - Added additional epoch constants for UTC/GPS/Unix alignment.
- Extended serde support and improved Postcard serialization test coverage.
- Added embedded-friendly serialization documentation improvements.
- Introduced new integration and round-trip test coverage across time scales.
Changed
- Refactored civil calendar conversion constants for improved clarity and symmetry.
- Improved architecture documentation consistency across crate, README, and internal modules.
- Improved
days_to_unix/civil_from_daysimplementation readability. - Updated feature-gated serialization strategy documentation.
Fixed
- Fixed potential overflow in
as_unix_nanosconversion for large timestamps.
Removed
- Removed legacy
benchesdirectory in favor of dedicated benchmark crate.
This release improves correctness, clarity, and extensibility of the time conversion layer while preserving full backward compatibility within the 0.5.x series.
v0.5.2
v0.5.1
v0.5.0
Added
-
Deterministic property test suite (
tests/prop_deterministic.rs)-
Fixed coverage for boundary values, all 18 leap-second transitions, uniform
u64space sampling, and real IGS epochs -
Verified invariants for:
- GPS ↔ TAI roundtrip
- GPS ↔ Galileo / BeiDou roundtrips
- GPS ↔ UTC correctness outside leap windows
- Arithmetic laws (identity, associativity, double negation)
- Sub-second boundary correctness
- Leap-second ambiguity window correctness
-
-
Randomized property tests (
tests/prop_tests.rs) usingproptest- GPS domain random sampling
- bounded duration strategies to prevent overflow
- ±3s leap-second boundary testing
- strict ambiguity coverage rules (
Exactoutside leap windows)
-
CI test orchestration in
justfiletest-deterministictest-propstest-all
-
Compile-time leap second validation:
_ASSERT_FIRST_ENTRY(TAI−UTC = 19)_ASSERT_TABLE_INVARIANTS(strict monotonic +1 progression)_ASSERT_LAST_ENTRY(2017-01-01, TAI−UTC = 37)
-
Runtime leap second subsystem:
RuntimeLeapSeconds(fixed-capacity, heap-free,RUNTIME_CAPACITY = 64)from_builtin(),from_slice(),try_extend()LeapExtendError(NotStrictlyAscending,NonUnitIncrement,BufferFull)
-
Leap second API extensions:
LeapSeconds::last_update()LeapSeconds::current_tai_minus_utc()
-
Prelude expansion:
RuntimeLeapSeconds,LeapExtendError,LeapEntry,RUNTIME_CAPACITYgps_to_utc,utc_to_gps
-
Cross-verification test:
test_builtin_table_matches_iers_bulletin_c(full IERS Bulletin C validation)
-
#[must_use]enforcement across core API:Time,Duration,ConvertResult,GnssTimeError- all arithmetic and conversion APIs
- all critical accessors
-
#[non_exhaustive]added to:GnssTimeErrorConvertResultConversionKindScaleId
-
clippy.tomlintroduced as future lint extension point
Changed
-
Property testing architecture split:
- deterministic tests (no randomness, full reproducibility)
proptest-based randomized validation (host-only)
-
proptestdependency updated:default-features = falsefeatures = ["std"]
-
Leap second table fully validated against IERS Bulletin C (19 entries, verified)
-
Documentation updated:
- runtime extension policy
- compile-time invariants
- IERS monitoring notes (TAI−UTC = 37 as of 2026)
-
LeapSecondsAPI improved:from_slicealias added for clarity
-
Enabled crate-wide lint:
#![warn(clippy::must_use_candidate)]
-
Improved forward compatibility via
#[non_exhaustive] -
Strengthened developer diagnostics and API safety rules
Fixed
-
Corrected internal type documentation:
i64 → u64for internal time representation consistency
v0.4.0
Deterministic API & Production Readiness
Release focused on determinism, correctness, and production readiness.
⚠️ Breaking Changes
- Removed all
f64-based constructors - Introduced
DurationParts { seconds, nanos }for exact, deterministic input
Added
DurationParts– deterministic replacement forf64with validationDurationParts::new()with range checkDurationParts::as_nanos() -> u128
- Full CI/CD pipeline (clippy, tests, docs, MSRV, cargo-deny)
- Embedded validation (
no_std, Cortex-M, RISC-V) - Automated publishing workflow
- Extended documentation:
- architecture, invariants, leap seconds, embedded usage
- Property-based tests (roundtrip, leap seconds, ordering)
Time::NANOS_PER_YEAR
Changed
- All constructors migrated to
DurationParts - Updated:
- all examples (17 files)
- integration tests
- benchmarks
- Added strict input validation
Performance
No regressions:
| Operation | Cost |
|---|---|
| Arithmetic (panicking) | ~0.5 ns (≈ raw u64) |
| Checked ops | ~4.3 ns |
| Fixed conversions | ~0.8–1.0 ns |
| UTC conversions | ~9–22 ns |
Notes
- Type-safe time domains preserved
- Fixed conversions remain zero-cost
- UTC stays explicit and leap-second aware
Upgrade
Replace:
// Before
Time::<Gps>::from_week_tow(week, 432_000.0)
// After
Time::<Gps>::from_week_tow(week, DurationParts {
seconds: 432_000,
nanos: 0,
})v0.3.0
Precision & Overflow (#TIME-11)
- Added
Time::MINconstant (alias forEPOCH) - Added documentation about value range:
Time<S>covers ~584 years from epoch (Time<Gps>up to year 2554) - Added
test_time_max_behaviorto verify overflow handling - Added
clippy::arithmetic_overflowlint to CI
Benchmarks (#TIME-12)
- Added
benches/arithmetic_bench.rs– proves zero-cost abstractions:Time<Gps> + Duration: 512 ps (rawu64 + u64: 517 ps)Time<Gps> - Duration: 512 ps (rawu64 - u64: 518 ps)
- Added
benches/convert_bench.rs:GPS → TAI: ~0.8 nsGPS → Galileo: ~0.8 nsGPS → BeiDou: ~0.9 nsGPS → UTC(with leap seconds): ~9.5 ns (< 10 ns target)GLONASS → UTC(constant shift): ~0.8 nsGLONASS → GPS(via UTC + LS): ~22.4 ns
- Uses
criterionwith HTML reports
Full no_std Compatibility (#TIME-10)
- All types are
Copy– no allocations anywhere defmt::Formatimplementation behinddefmtfeature flag- Fixed
LeapSeconds::builtin()– now uses static instance instead ofconst fn - Cross-compilation tests for embedded targets:
thumbv7em-none-eabihf(STM32F4/F7, nRF52)thumbv7em-none-eabi(Cortex-M4/M7)riscv32imac-unknown-none-elf(ESP32-C3, GD32VF103)
- Added
.cargo/config.tomlwith embedded optimization settings - Added
tests/no_std_compact.rs– verifies noDrop,Copysemantics, 8-byte alignment, no allocations
CI & Project Infrastructure
- Added
.github/workflows/embedded.yml– cross-compilation checks - Added
.github/workflows/semantic-pull-request.yml– validates PR titles (feat:,fix:, etc.) - Added
.github/pull_request_template.md– structured checklist - Added
.github/ISSUE_TEMPLATE/enhancement.yml– enhancement request template - Added
CODEOWNERS– automatic reviewer assignment - Updated
justfilewith new commands (check-no-std,ci, etc.) - Updated
Cargo.tomlwithdefmtfeature, docs.rs metadata
Fixed
leap.rs:LeapSeconds::builtin()now works inno_std(static instance, notconst fn)time.rs: removedconstfromas_seconds_f64(no_std compatibility)time.rs: fixed typo "Дипазон значений" → "Диапазон значений"
Full Changelog
See CHANGELOG.md
v0.2.0
Full Conversion Matrix & Typed Conversion API
This release introduces a complete 6×6 GNSS time conversion matrix,
a unified conversion API, and improved correctness around leap seconds.
Highlights:
- Full conversion matrix (30 directions)
- Runtime conversion graph inspection (
ConversionMatrix) - Typed conversion traits:
IntoScale,IntoScaleWith - Leap second–aware conversions with ambiguity handling
- GLONASS-specific time utilities
- <1 ns roundtrip accuracy (except intrinsic leap second ambiguity)
This is a foundational release: gnss-time is now a complete,
type-safe core for GNSS time transformations.
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