Skip to main content

Crate gnss_time

Crate gnss_time 

Source
Expand description

§gnss-time

A type-safe GNSS time scale library with zero runtime overhead.

Supports conversions between:

  • GPS
  • UTC
  • GLONASS
  • Galileo
  • BeiDou
  • TAI

Leap seconds are handled explicitly via a provider trait, ensuring deterministic behavior and full no_std compatibility.

§Design goals

  • Zero allocations
  • No global mutable state
  • Fully deterministic conversions
  • Embedded-friendly (no_std)
  • Strong type safety across time scales

§Quick start

use gnss_time::prelude::*;

let gps = Time::<Gps>::from_week_tow(
    2345,
    DurationParts {
        seconds: 432_000,
        nanos: 0,
    },
)
.unwrap();

assert_eq!(gps.to_string(), "GPS 2345:432000.000");

let utc: Time<Utc> = gps.into_scale_with(LeapSeconds::builtin()).unwrap();

Re-exports§

pub use convert::*;
pub use duration::*;
pub use epoch::*;
pub use error::*;
pub use leap::*;
pub use matrix::*;
pub use scale::*;
pub use time::*;

Modules§

convert
GNSS time scale conversion
duration
Duration
epoch
Epochs and calendar arithmetic
error
Error types for the gnss-time crate.
leap
Leap seconds — conversion context
matrix
Conversion matrix: the full graph of supported transformations
prelude
Common imports for typical usage.
scale
GNSS Time Scale Marker Types
time
Time<S> — the core timestamp type.