Struct nyx_space::time::Epoch [−][src]
Defines an Epoch in TAI (temps atomique international) in seconds past 1900 January 01 at midnight (like the Network Time Protocol).
Refer to the appropriate functions for initializing this Epoch from different time systems or representations.
Implementations
impl Epoch
[src]
pub fn from_tai_seconds(seconds: f64) -> Epoch
[src]
Initialize an Epoch from the provided TAI seconds since 1900 January 01 at midnight
pub fn from_tai_days(days: f64) -> Epoch
[src]
Initialize an Epoch from the provided TAI days since 1900 January 01 at midnight
pub fn from_mjd_tai(days: f64) -> Epoch
[src]
pub fn from_jde_tai(days: f64) -> Epoch
[src]
pub fn from_tt_seconds(seconds: f64) -> Epoch
[src]
Initialize an Epoch from the provided TT seconds (approximated to 32.184s delta from TAI)
pub fn from_et_seconds(seconds: f64) -> Epoch
[src]
pub fn from_tdb_seconds(seconds: f64) -> Epoch
[src]
Initialize from Dynamic Barycentric Time (TDB) (same as SPICE ephemeris time) whose epoch is 2000 JAN 01 noon TAI
pub fn from_jde_et(days: f64) -> Epoch
[src]
pub fn from_jde_tdb(days: f64) -> Epoch
[src]
Initialize from Dynamic Barycentric Time (TDB) (same as SPICE ephemeris time) in JD days
pub fn maybe_from_gregorian_tai(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Result<Epoch, Errors>
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Result<Epoch, Errors>
Attempts to build an Epoch from the provided Gregorian date and time in TAI.
pub fn maybe_from_gregorian(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32,
ts: TimeSystem
) -> Result<Epoch, Errors>
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32,
ts: TimeSystem
) -> Result<Epoch, Errors>
Attempts to build an Epoch from the provided Gregorian date and time in the provided time system.
pub fn from_gregorian_tai(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Epoch
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Epoch
Builds an Epoch from the provided Gregorian date and time in TAI. If invalid date is provided, this function will panic. Use maybe_from_gregorian_tai if unsure.
pub fn from_gregorian_tai_at_midnight(year: i32, month: u8, day: u8) -> Epoch
[src]
pub fn from_gregorian_tai_at_noon(year: i32, month: u8, day: u8) -> Epoch
[src]
pub fn from_gregorian_tai_hms(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Epoch
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Epoch
pub fn maybe_from_gregorian_utc(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Result<Epoch, Errors>
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Result<Epoch, Errors>
Attempts to build an Epoch from the provided Gregorian date and time in UTC.
pub fn from_gregorian_utc(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Epoch
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanos: u32
) -> Epoch
Builds an Epoch from the provided Gregorian date and time in TAI. If invalid date is provided, this function will panic. Use maybe_from_gregorian_tai if unsure.
pub fn from_gregorian_utc_at_midnight(year: i32, month: u8, day: u8) -> Epoch
[src]
pub fn from_gregorian_utc_at_noon(year: i32, month: u8, day: u8) -> Epoch
[src]
pub fn from_gregorian_utc_hms(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Epoch
[src]
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8
) -> Epoch
pub fn as_tai_seconds(self) -> f64
[src]
pub fn as_tai_duration(self) -> Duration
[src]
Returns this time in a Duration past J1900 counted in TAI
pub fn as_tai(self, unit: TimeUnit) -> f64
[src]
Returns the epoch as a floating point value in the provided unit
pub fn as_tai_days(self) -> f64
[src]
pub fn as_utc_seconds(self) -> f64
[src]
Returns the number of UTC seconds since the TAI epoch
pub fn as_utc(self, unit: TimeUnit) -> f64
[src]
Returns the number of UTC seconds since the TAI epoch
pub fn as_utc_days(self) -> f64
[src]
Returns the number of UTC days since the TAI epoch
pub fn as_mjd_tai_days(self) -> f64
[src]
as_mjd_days
creates an Epoch from the provided Modified Julian Date in days as explained
here. MJD epoch is Modified Julian Day at 17 November 1858 at midnight.
pub fn as_mjd_tai_seconds(self) -> f64
[src]
Returns the Modified Julian Date in seconds TAI.
pub fn as_mjd_tai(self, unit: TimeUnit) -> f64
[src]
pub fn as_mjd_utc_days(self) -> f64
[src]
Returns the Modified Julian Date in days UTC.
pub fn as_mjd_utc(self, unit: TimeUnit) -> f64
[src]
Returns the Modified Julian Date in the provided unit in UTC.
pub fn as_mjd_utc_seconds(self) -> f64
[src]
Returns the Modified Julian Date in seconds UTC.
pub fn as_jde_tai_days(self) -> f64
[src]
Returns the Julian days from epoch 01 Jan -4713, 12:00 (noon) as explained in “Fundamentals of astrodynamics and applications”, Vallado et al. 4th edition, page 182, and on Wikipedia.
pub fn as_jde_tai(self, unit: TimeUnit) -> f64
[src]
pub fn as_jde_tai_duration(self) -> Duration
[src]
pub fn as_jde_tai_seconds(self) -> f64
[src]
Returns the Julian seconds in TAI.
pub fn as_jde_utc_days(self) -> f64
[src]
Returns the Julian days in UTC.
pub fn as_jde_utc_duration(self) -> Duration
[src]
pub fn as_jde_utc_seconds(self) -> f64
[src]
Returns the Julian seconds in UTC.
pub fn as_tt_seconds(self) -> f64
[src]
Returns seconds past TAI epoch in Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT))
pub fn as_tt_duration(self) -> Duration
[src]
pub fn as_tt_days(self) -> f64
[src]
Returns days past TAI epoch in Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT))
pub fn as_tt_centuries_j2k(self) -> f64
[src]
Returns the centuries pased J2000 TT
pub fn as_tt_since_j2k(self) -> Duration
[src]
Returns the duration past J2000 TT
pub fn as_jde_tt_days(self) -> f64
[src]
Returns days past Julian epoch in Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT))
pub fn as_jde_tt_duration(self) -> Duration
[src]
pub fn as_mjd_tt_days(self) -> f64
[src]
Returns days past Modified Julian epoch in Terrestrial Time (TT) (previously called Terrestrial Dynamical Time (TDT))
pub fn as_mjd_tt_duration(self) -> Duration
[src]
pub fn as_gpst_seconds(self) -> f64
[src]
Returns seconds past GPS Time Epoch, defined as UTC midnight of January 5th to 6th 1980 (cf. https://gssc.esa.int/navipedia/index.php/Time_References_in_GNSS#GPS_Time_.28GPST.29).
pub fn as_gpst_duration(self) -> Duration
[src]
pub fn as_gpst_days(self) -> f64
[src]
Returns days past GPS Time Epoch, defined as UTC midnight of January 5th to 6th 1980 (cf. https://gssc.esa.int/navipedia/index.php/Time_References_in_GNSS#GPS_Time_.28GPST.29).
pub fn as_et_seconds(self) -> f64
[src]
Returns the Ephemeris Time seconds past epoch
pub fn as_et_duration(self) -> Duration
[src]
pub fn as_tdb_seconds(self) -> f64
[src]
Returns the Dynamic Barycentric Time (TDB) (higher fidelity SPICE ephemeris time) whose epoch is 2000 JAN 01 noon TAI (cf. https://gssc.esa.int/navipedia/index.php/Transformations_between_Time_Systems#TDT_-_TDB.2C_TCB)
pub fn as_tdb_duration(self) -> Duration
[src]
pub fn as_jde_et_days(self) -> f64
[src]
Returns the Ephemeris Time JDE past epoch
pub fn as_jde_et_duration(self) -> Duration
[src]
pub fn as_jde_et(self, unit: TimeUnit) -> f64
[src]
pub fn as_jde_tdb_duration(self) -> Duration
[src]
pub fn as_jde_tdb_days(self) -> f64
[src]
Returns the Dynamic Barycentric Time (TDB) (higher fidelity SPICE ephemeris time) whose epoch is 2000 JAN 01 noon TAI (cf. https://gssc.esa.int/navipedia/index.php/Transformations_between_Time_Systems#TDT_-_TDB.2C_TCB)
pub fn from_gregorian_str(s: &str) -> Result<Epoch, Errors>
[src]
Converts an ISO8601 Datetime representation without timezone offset to an Epoch.
If no time system is specified, than UTC is assumed.
The T
which separates the date from the time can be replaced with a single whitespace character (\W
).
The offset is also optional, cf. the examples below.
Example
use hifitime::Epoch; let dt = Epoch::from_gregorian_utc(2017, 1, 14, 0, 31, 55, 0); assert_eq!( dt, Epoch::from_gregorian_str("2017-01-14T00:31:55 UTC").unwrap() ); assert_eq!( dt, Epoch::from_gregorian_str("2017-01-14T00:31:55.0000 UTC").unwrap() ); assert_eq!( dt, Epoch::from_gregorian_str("2017-01-14T00:31:55").unwrap() ); assert_eq!( dt, Epoch::from_gregorian_str("2017-01-14 00:31:55").unwrap() );
pub fn as_gregorian_utc(self) -> (i32, u8, u8, u8, u8, u8, u32)
[src]
Converts the Epoch to the Gregorian UTC equivalent as (year, month, day, hour, minute, second). WARNING: Nanoseconds are lost in this conversion!
Example
use hifitime::Epoch; let dt_str = "2017-01-14T00:31:55 UTC"; let dt = Epoch::from_gregorian_str(dt_str).unwrap(); let (y, m, d, h, min, s, _) = dt.as_gregorian_utc(); assert_eq!(y, 2017); assert_eq!(m, 1); assert_eq!(d, 14); assert_eq!(h, 0); assert_eq!(min, 31); assert_eq!(s, 55); assert_eq!(dt_str, dt.as_gregorian_utc_str().to_owned());
pub fn as_gregorian_utc_str(self) -> String
[src]
Converts the Epoch to UTC Gregorian in the ISO8601 format.
pub fn as_gregorian_tai(self) -> (i32, u8, u8, u8, u8, u8, u32)
[src]
Converts the Epoch to the Gregorian TAI equivalent as (year, month, day, hour, minute, second). WARNING: Nanoseconds are lost in this conversion!
Example
use hifitime::Epoch; let dt = Epoch::from_gregorian_tai_at_midnight(1972, 1, 1); let (y, m, d, h, min, s, _) = dt.as_gregorian_tai(); assert_eq!(y, 1972); assert_eq!(m, 1); assert_eq!(d, 1); assert_eq!(h, 0); assert_eq!(min, 0); assert_eq!(s, 0);
pub fn as_gregorian_tai_str(self) -> String
[src]
Converts the Epoch to TAI Gregorian in the ISO8601 format with “ TAI“ appended to the string
pub fn as_gregorian_str(self, ts: TimeSystem) -> String
[src]
Converts the Epoch to Gregorian in the provided time system and in the ISO8601 format with the time system appended to the string
Trait Implementations
impl Add<Duration> for Epoch
[src]
type Output = Epoch
The resulting type after applying the +
operator.
pub fn add(self, duration: Duration) -> Epoch
[src]
impl Add<TimeUnit> for Epoch
[src]
type Output = Epoch
The resulting type after applying the +
operator.
pub fn add(self, unit: TimeUnit) -> Epoch
[src]
impl Add<f64> for Epoch
[src]
type Output = Epoch
The resulting type after applying the +
operator.
pub fn add(self, seconds: f64) -> Epoch
[src]
WARNING: For speed, there is a possibility to add seconds directly to an Epoch. Using this is discouraged and should only be used if you have facing bottlenecks with the units.
impl AddAssign<Duration> for Epoch
[src]
pub fn add_assign(&mut self, duration: Duration)
[src]
impl AddAssign<TimeUnit> for Epoch
[src]
pub fn add_assign(&mut self, unit: TimeUnit)
[src]
impl Clone for Epoch
[src]
impl Copy for Epoch
[src]
impl Debug for Epoch
[src]
impl<'de> Deserialize<'de> for Epoch
[src]
pub fn deserialize<D>(
deserializer: D
) -> Result<Epoch, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
deserializer: D
) -> Result<Epoch, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Display for Epoch
[src]
pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
[src]
The default format of an epoch is in TAI
impl FromStr for Epoch
[src]
type Err = Errors
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<Epoch, <Epoch as FromStr>::Err>
[src]
Attempts to convert a string to an Epoch.
Format identifiers: + JD: Julian days + MJD: Modified Julian days + SEC: Seconds past a given epoch (e.g. SEC 17.2 TAI is 17.2 seconds past TAI Epoch)
Example
use hifitime::Epoch; use std::str::FromStr; assert!(Epoch::from_str("JD 2452312.500372511 TDB").is_ok()); assert!(Epoch::from_str("JD 2452312.500372511 ET").is_ok()); assert!(Epoch::from_str("JD 2452312.500372511 TAI").is_ok()); assert!(Epoch::from_str("MJD 51544.5 TAI").is_ok()); assert!(Epoch::from_str("SEC 0.5 TAI").is_ok()); assert!(Epoch::from_str("SEC 66312032.18493909 TDB").is_ok());
impl PartialEq<Epoch> for Epoch
[src]
impl PartialOrd<Epoch> for Epoch
[src]
pub fn partial_cmp(&self, other: &Epoch) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralPartialEq for Epoch
[src]
impl Sub<Duration> for Epoch
[src]
type Output = Epoch
The resulting type after applying the -
operator.
pub fn sub(self, duration: Duration) -> Epoch
[src]
impl Sub<Epoch> for Epoch
[src]
type Output = Duration
The resulting type after applying the -
operator.
pub fn sub(self, other: Epoch) -> Duration
[src]
impl Sub<TimeUnit> for Epoch
[src]
type Output = Epoch
The resulting type after applying the -
operator.
pub fn sub(self, unit: TimeUnit) -> Epoch
[src]
impl SubAssign<Duration> for Epoch
[src]
pub fn sub_assign(&mut self, duration: Duration)
[src]
impl SubAssign<TimeUnit> for Epoch
[src]
pub fn sub_assign(&mut self, unit: TimeUnit)
[src]
Auto Trait Implementations
impl RefUnwindSafe for Epoch
impl Send for Epoch
impl Sync for Epoch
impl Unpin for Epoch
impl UnwindSafe for Epoch
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, Right> ClosedAdd<Right> for T where
T: Add<Right, Output = T> + AddAssign<Right>,
T: Add<Right, Output = T> + AddAssign<Right>,
impl<T, Right> ClosedSub<Right> for T where
T: Sub<Right, Output = T> + SubAssign<Right>,
T: Sub<Right, Output = T> + SubAssign<Right>,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Scalar for T where
T: PartialEq<T> + Copy + Any + Debug,
[src]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,