Skip to content

v0.4.0

Choose a tag to compare

@MiCkEyZzZ MiCkEyZzZ released this 02 May 05:47

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 for f64 with validation
    • DurationParts::new() with range check
    • DurationParts::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,
})