Skip to main content

tempoch_core/format/
time_format.rs

1// SPDX-License-Identifier: AGPL-3.0-only
2// Copyright (C) 2026 Vallés Puig, Ramon
3
4//! Scale-orthogonal [`TimeFormat`] trait.
5//!
6//! Built-in markers live in [`crate::format::markers`].
7
8use core::fmt;
9
10use crate::foundation::sealed::Sealed;
11use qtty::Unit;
12
13/// Marker trait for an external time encoding such as JD or Unix time.
14#[allow(private_bounds)]
15pub trait TimeFormat: Sealed + Copy + Clone + fmt::Debug + 'static {
16    type Unit: Unit;
17    const NAME: &'static str;
18}
19
20#[allow(unused_imports)]
21pub use crate::format::markers::{J2000s, Unix, GPS, JD, MJD};