Skip to main content

TAI

Struct TAI 

Source
pub struct TAI(/* private fields */);
Expand description

International Atomic Time representation.

Wraps a JulianDate to provide TAI-specific semantics. TAI serves as the hub for conversions between other time scales (UTC, TT, GPS, TDB, etc.).

Implementations§

Source§

impl TAI

Source

pub fn new(seconds: i64, nanos: u32) -> TAI

Creates TAI from Unix timestamp components.

Converts seconds since 1970-01-01 00:00:00 plus nanoseconds to TAI. Note: This assumes the input is already in TAI, not UTC.

Source

pub fn from_julian_date(jd: JulianDate) -> TAI

Creates TAI from a JulianDate.

Source

pub fn from_julian_date_raw(jd1: f64, jd2: f64) -> TAI

Creates TAI from raw Julian Date components.

Useful when you already have the split JD representation and want to avoid the overhead of creating a JulianDate first.

Source

pub fn j2000() -> TAI

Returns TAI at the J2000.0 epoch (2000-01-01 12:00:00 TT).

JD = 2451545.0

Source

pub fn to_julian_date(&self) -> JulianDate

Returns the underlying Julian Date.

Source

pub fn add_seconds(&self, seconds: f64) -> TAI

Returns a new TAI offset by the given number of seconds.

Source

pub fn add_days(&self, days: f64) -> TAI

Returns a new TAI offset by the given number of days.

Trait Implementations§

Source§

impl Clone for TAI

Source§

fn clone(&self) -> TAI

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TAI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for TAI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats as “TAI {julian_date}”.

Source§

impl From<JulianDate> for TAI

Source§

fn from(jd: JulianDate) -> TAI

Converts to this type from the input type.
Source§

impl FromStr for TAI

Source§

fn from_str(s: &str) -> Result<TAI, TimeError>

Parses an ISO 8601 datetime string as TAI.

The input is interpreted directly as TAI with no UTC-to-TAI conversion. For UTC input, parse as UTC first, then convert to TAI.

Source§

type Err = TimeError

The associated error which can be returned from parsing.
Source§

impl PartialEq for TAI

Source§

fn eq(&self, other: &TAI) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToGPS for TAI

TAI to GPS conversion. Subtracts 19 seconds.

Source§

fn to_gps(&self) -> Result<GPS, TimeError>

Converts TAI to GPS time by subtracting the fixed 19-second offset.

The offset is subtracted from the smaller-magnitude JD component to preserve precision.

Source§

impl ToTAI for TAI

Identity conversion for TAI.

Source§

fn to_tai(&self) -> Result<TAI, TimeError>

Convert to TAI.
Source§

impl ToTCG for TAI

Convert TAI to TCG by chaining through TT.

TAI has no direct conversion to TCG. This chains: TAI → TT → TCG.

Source§

fn to_tcg(&self) -> Result<TCG, TimeError>

Convert to Geocentric Coordinate Time.
Source§

impl ToTT for TAI

Convert TAI to TT by adding the fixed 32.184 second offset.

The offset is added to whichever Julian Date component has smaller magnitude to preserve maximum precision in the two-part representation.

Source§

fn to_tt(&self) -> Result<TT, TimeError>

Convert to Terrestrial Time.
Source§

impl ToUT1WithOffset for TAI

Source§

fn to_ut1_with_offset( &self, ut1_tai_offset_seconds: f64, ) -> Result<UT1, TimeError>

Convert to UT1 using the given UT1-TAI offset in seconds. Read more
Source§

impl ToUTC for TAI

Source§

fn to_utc(&self) -> Result<UTC, TimeError>

Convert TAI to UTC using iterative refinement.

Uses 3 iterations to converge on the correct UTC instant, handling leap second boundaries where a single TAI instant may map to the leap second itself.

Source§

impl Copy for TAI

Source§

impl StructuralPartialEq for TAI

Auto Trait Implementations§

§

impl Freeze for TAI

§

impl RefUnwindSafe for TAI

§

impl Send for TAI

§

impl Sync for TAI

§

impl Unpin for TAI

§

impl UnsafeUnpin for TAI

§

impl UnwindSafe for TAI

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.