Skip to main content

Crate lox_time

Crate lox_time 

Source
Expand description

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.

Re-exports§

pub use time::DynTime;
pub use time::Time;
pub use time::TimeBuilder;
pub use time::TimeError;

Modules§

calendar_dates
Calendar date types (re-exported from lox-core).
deltas
Time deltas (re-exported from lox-core).
intervals
Time intervals and set operations on them.
julian_dates
Julian date types (re-exported from lox-core).
offsets
Time scale offset computation.
subsecond
Sub-second precision types (re-exported from lox-core).
time
The Time type representing an instant in a continuous time scale.
time_of_day
Time-of-day types (re-exported from lox-core).
time_scales
Astronomical time scale definitions. Module time_scales provides a marker trait denoting a continuous astronomical time scale, along with zero-sized implementations for the most commonly used scales.
utc
Coordinated Universal Time (UTC) with leap-second support. Module utc exposes [Utc], a leap-second aware representation for UTC datetimes.

Macros§

time
Convenience macro to simplify the construction of Time instances.
utc
The utc macro simplifies the creation of Utc instances.