#ecosystem #lox-time #time

lox-time

Time modelling tools for the Lox ecosystem

7 releases

Uses new Rust 2024

0.1.0-alpha.6 Mar 4, 2025
0.1.0-alpha.5 Feb 11, 2025
0.1.0-alpha.3 Jan 25, 2025
0.1.0-alpha.2 Dec 18, 2024
0.1.0-alpha.0 Jul 19, 2024

#105 in Robotics

Download history 31/week @ 2024-12-05 80/week @ 2024-12-12 90/week @ 2024-12-19 2/week @ 2024-12-26 1/week @ 2025-01-09 117/week @ 2025-01-23 16/week @ 2025-01-30 231/week @ 2025-02-06 110/week @ 2025-02-13 12/week @ 2025-02-20 118/week @ 2025-02-27 37/week @ 2025-03-06 5/week @ 2025-03-13 4/week @ 2025-03-20

166 downloads per month
Used in 3 crates

MPL-2.0 license

720KB
16K SLoC

lox-time defines an API for working with instants in astronomical time scales.

Overview

lox_time exposes:

  • the marker trait [TimeScale] and zero-sized implementations representing the most common, continuous astronomical time scales;
  • the concrete type [Time] representing an instant in a [TimeScale];
  • [Utc], the only discontinuous time representation supported by Lox;
  • the [TryToScale] and [ToScale] traits, supporting transformations between pairs of time scales;
  • standard implementations of the most common time scale transformations.

Continuous vs discontinuous timescales

Internally, Lox uses only continuous time scales (i.e. time scales without leap seconds). An instance of [Time] represents an instant in time generic over a continuous [TimeScale].

[Utc] is used strictly as an I/O time format, which must be transformed into a continuous time scale before use in the wider Lox ecosystem.

This separation minimises the complexity in working with leap seconds, confining these transformations to the crate boundaries.

Dependencies

~16MB
~335K SLoC