Skip to main content

Time

Struct Time 

Source
pub struct Time<S: TimeScale> { /* private fields */ }
Expand description

A point on time scale S.

Internally stores a single Days quantity whose interpretation depends on S: TimeScale. The struct is Copy and zero-cost: PhantomData is zero-sized, so Time<S> is layout-identical to Days (a single f64).

Implementations§

Source§

impl Time<UT>

Source

pub fn delta_t(&self) -> Seconds

Returns ΔT = TT − UT in seconds for this UT epoch.

This is a convenience accessor; the same correction is applied automatically when converting to any TT-based scale (.to::<JD>()).

Source§

impl<S: TimeScale> Time<S>

Source

pub const fn new(value: f64) -> Self

Create from a raw scalar (days since the scale’s epoch).

Note: this constructor accepts any f64, including NaN and ±∞. Prefer try_new when the value comes from untrusted or computed input.

Source

pub fn try_new(value: f64) -> Result<Self, NonFiniteTimeError>

Create from a raw scalar, rejecting non-finite values.

Returns NonFiniteTimeError if value is NaN, +∞, or −∞.

§Examples
use tempoch::{Time, JD};

assert!(Time::<JD>::try_new(2451545.0).is_ok());
assert!(Time::<JD>::try_new(f64::NAN).is_err());
assert!(Time::<JD>::try_new(f64::INFINITY).is_err());
Source

pub const fn from_days(days: Days) -> Self

Create from a Days quantity.

Note: this constructor accepts any f64, including NaN and ±∞. Prefer try_from_days when the value comes from untrusted or computed input.

Source

pub fn try_from_days(days: Days) -> Result<Self, NonFiniteTimeError>

Create from a Days quantity, rejecting non-finite values.

Returns NonFiniteTimeError if the underlying value is NaN, +∞, or −∞.

Source

pub const fn quantity(&self) -> Days

The underlying quantity in days.

Source

pub const fn value(&self) -> f64

The underlying scalar value in days.

Source

pub fn julian_day(&self) -> Days

Absolute Julian Day (TT) corresponding to this instant.

Source

pub fn julian_day_value(&self) -> f64

Absolute Julian Day (TT) as scalar.

Source

pub fn from_julian_day(jd: Days) -> Self

Build an instant from an absolute Julian Day (TT).

Source

pub fn to<T: TimeScale>(&self) -> Time<T>

Convert this instant to another time scale.

The conversion routes through the canonical JD(TT) intermediate:

self → JD(TT) → target

For pure epoch-offset scales this compiles down to a single addition/subtraction.

Source

pub fn to_utc(&self) -> Option<DateTime<Utc>>

Convert to a chrono::DateTime<Utc>.

Inverts the ΔT correction to recover the UTC / UT timestamp. Returns None if the value falls outside chrono’s representable range.

Source

pub fn from_utc(datetime: DateTime<Utc>) -> Self

Build an instant from a chrono::DateTime<Utc>.

The UTC timestamp is interpreted as Universal Time (≈ UT1) and the epoch-dependent ΔT correction is applied automatically, so the resulting Time<S> is on the target scale’s axis.

Source

pub const fn min(self, other: Self) -> Self

Element-wise minimum.

Source

pub const fn max(self, other: Self) -> Self

Element-wise maximum.

Source

pub const fn mean(self, other: Self) -> Self

Mean (midpoint) between two instants on the same time scale.

Source§

impl Time<JD>

Source

pub const J2000: Self

J2000.0 epoch: 2000-01-01T12:00:00 TT (JD 2 451 545.0).

Source

pub const JULIAN_YEAR: Days

One Julian year expressed in days.

Source

pub const JULIAN_CENTURY: Days

One Julian century expressed in days.

Source

pub const JULIAN_MILLENNIUM: Days

One Julian millennium expressed in days.

Source

pub fn julian_millennias(&self) -> Millennia

Julian millennia since J2000.0 (used by VSOP87).

Source

pub fn julian_centuries(&self) -> Centuries

Julian centuries since J2000.0 (used by nutation, precession, sidereal time).

Source

pub fn julian_years(&self) -> JulianYears

Julian years since J2000.0.

Source

pub fn tt_to_tdb(jd_tt: Self) -> Self

Converts JD(TT) → JD(TDB) using the Fairhead & Bretagnon (1990) expression for TDB − TT.

The dominant term has an amplitude of ≈1.658 ms. This implementation includes the four largest periodic terms plus a secular component, matching the formula recommended by USNO Circular 179 (Kaplan 2005) and consistent with IAU 2006 Resolution B3.

Accuracy: better than 30 μs for dates within ±10 000 years of J2000.

§References
  • Fairhead & Bretagnon (1990), A&A 229, 240
  • USNO Circular 179, eq. 2.6
  • SOFA iauDtdb (full implementation has hundreds of terms)
Source

pub fn to_mjd(&self) -> Time<MJD>

Convenience: MJD value corresponding to this JD.

Kept as a convenience wrapper for self.to::<MJD>().

Trait Implementations§

Source§

impl<S: TimeScale> Add<Quantity<Day>> for Time<S>

Source§

type Output = Time<S>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Days) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Quantity<Year>> for Time<JD>

Source§

type Output = Time<JD>

The resulting type after applying the + operator.
Source§

fn add(self, years: Years) -> Self

Performs the + operation. Read more
Source§

impl<S: TimeScale> AddAssign<Quantity<Day>> for Time<S>

Source§

fn add_assign(&mut self, rhs: Days)

Performs the += operation. Read more
Source§

impl<S: Clone + TimeScale> Clone for Time<S>

Source§

fn clone(&self) -> Time<S>

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<S: Debug + TimeScale> Debug for Time<S>

Source§

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

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

impl<S: TimeScale> Display for Time<S>

Source§

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

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

impl<S: TimeScale> Div<Quantity<Day>> for Time<S>

Source§

type Output = f64

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Days) -> Self::Output

Performs the / operation. Read more
Source§

impl<S: TimeScale> Div<f64> for Time<S>

Source§

type Output = f64

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl From<Quantity<Century>> for Time<JD>

Source§

fn from(centuries: Centuries) -> Self

Converts to this type from the input type.
Source§

impl<S: TimeScale> From<Quantity<Day>> for Time<S>

Source§

fn from(days: Days) -> Self

Converts to this type from the input type.
Source§

impl From<Quantity<JulianYear>> for Time<JD>

Source§

fn from(years: JulianYears) -> Self

Converts to this type from the input type.
Source§

impl From<Quantity<Millennium>> for Time<JD>

Source§

fn from(millennia: Millennia) -> Self

Converts to this type from the input type.
Source§

impl From<Time<GPS>> for Time<JD>

Source§

fn from(t: Time<GPS>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<GPS>> for Time<JDE>

Source§

fn from(t: Time<GPS>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<GPS>> for Time<MJD>

Source§

fn from(t: Time<GPS>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<GPS>> for Time<TAI>

Source§

fn from(t: Time<GPS>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<GPS>> for Time<TCB>

Source§

fn from(t: Time<GPS>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<GPS>> for Time<TCG>

Source§

fn from(t: Time<GPS>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<GPS>> for Time<TDB>

Source§

fn from(t: Time<GPS>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<GPS>> for Time<TT>

Source§

fn from(t: Time<GPS>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<GPS>> for Time<UT>

Source§

fn from(t: Time<GPS>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<GPS>> for Time<UnixTime>

Source§

fn from(t: Time<GPS>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for Centuries

Source§

fn from(jd: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for JulianYears

Source§

fn from(jd: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for Millennia

Source§

fn from(jd: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for Time<GPS>

Source§

fn from(t: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for Time<JDE>

Source§

fn from(t: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for Time<MJD>

Source§

fn from(t: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for Time<TAI>

Source§

fn from(t: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for Time<TCB>

Source§

fn from(t: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for Time<TCG>

Source§

fn from(t: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for Time<TDB>

Source§

fn from(t: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for Time<TT>

Source§

fn from(t: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for Time<UT>

Source§

fn from(t: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JD>> for Time<UnixTime>

Source§

fn from(t: Time<JD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JDE>> for Time<GPS>

Source§

fn from(t: Time<JDE>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JDE>> for Time<JD>

Source§

fn from(t: Time<JDE>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JDE>> for Time<MJD>

Source§

fn from(t: Time<JDE>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JDE>> for Time<TAI>

Source§

fn from(t: Time<JDE>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JDE>> for Time<TCB>

Source§

fn from(t: Time<JDE>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JDE>> for Time<TCG>

Source§

fn from(t: Time<JDE>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JDE>> for Time<TDB>

Source§

fn from(t: Time<JDE>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JDE>> for Time<TT>

Source§

fn from(t: Time<JDE>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JDE>> for Time<UT>

Source§

fn from(t: Time<JDE>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<JDE>> for Time<UnixTime>

Source§

fn from(t: Time<JDE>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<MJD>> for Time<GPS>

Source§

fn from(t: Time<MJD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<MJD>> for Time<JD>

Source§

fn from(t: Time<MJD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<MJD>> for Time<JDE>

Source§

fn from(t: Time<MJD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<MJD>> for Time<TAI>

Source§

fn from(t: Time<MJD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<MJD>> for Time<TCB>

Source§

fn from(t: Time<MJD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<MJD>> for Time<TCG>

Source§

fn from(t: Time<MJD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<MJD>> for Time<TDB>

Source§

fn from(t: Time<MJD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<MJD>> for Time<TT>

Source§

fn from(t: Time<MJD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<MJD>> for Time<UT>

Source§

fn from(t: Time<MJD>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<MJD>> for Time<UnixTime>

Source§

fn from(t: Time<MJD>) -> Self

Converts to this type from the input type.
Source§

impl<S: TimeScale> From<Time<S>> for Days

Source§

fn from(time: Time<S>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TAI>> for Time<GPS>

Source§

fn from(t: Time<TAI>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TAI>> for Time<JD>

Source§

fn from(t: Time<TAI>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TAI>> for Time<JDE>

Source§

fn from(t: Time<TAI>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TAI>> for Time<MJD>

Source§

fn from(t: Time<TAI>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TAI>> for Time<TCB>

Source§

fn from(t: Time<TAI>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TAI>> for Time<TCG>

Source§

fn from(t: Time<TAI>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TAI>> for Time<TDB>

Source§

fn from(t: Time<TAI>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TAI>> for Time<TT>

Source§

fn from(t: Time<TAI>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TAI>> for Time<UT>

Source§

fn from(t: Time<TAI>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TAI>> for Time<UnixTime>

Source§

fn from(t: Time<TAI>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCB>> for Time<GPS>

Source§

fn from(t: Time<TCB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCB>> for Time<JD>

Source§

fn from(t: Time<TCB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCB>> for Time<JDE>

Source§

fn from(t: Time<TCB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCB>> for Time<MJD>

Source§

fn from(t: Time<TCB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCB>> for Time<TAI>

Source§

fn from(t: Time<TCB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCB>> for Time<TCG>

Source§

fn from(t: Time<TCB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCB>> for Time<TDB>

Source§

fn from(t: Time<TCB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCB>> for Time<TT>

Source§

fn from(t: Time<TCB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCB>> for Time<UT>

Source§

fn from(t: Time<TCB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCB>> for Time<UnixTime>

Source§

fn from(t: Time<TCB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCG>> for Time<GPS>

Source§

fn from(t: Time<TCG>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCG>> for Time<JD>

Source§

fn from(t: Time<TCG>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCG>> for Time<JDE>

Source§

fn from(t: Time<TCG>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCG>> for Time<MJD>

Source§

fn from(t: Time<TCG>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCG>> for Time<TAI>

Source§

fn from(t: Time<TCG>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCG>> for Time<TCB>

Source§

fn from(t: Time<TCG>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCG>> for Time<TDB>

Source§

fn from(t: Time<TCG>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCG>> for Time<TT>

Source§

fn from(t: Time<TCG>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCG>> for Time<UT>

Source§

fn from(t: Time<TCG>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TCG>> for Time<UnixTime>

Source§

fn from(t: Time<TCG>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TDB>> for Time<GPS>

Source§

fn from(t: Time<TDB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TDB>> for Time<JD>

Source§

fn from(t: Time<TDB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TDB>> for Time<JDE>

Source§

fn from(t: Time<TDB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TDB>> for Time<MJD>

Source§

fn from(t: Time<TDB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TDB>> for Time<TAI>

Source§

fn from(t: Time<TDB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TDB>> for Time<TCB>

Source§

fn from(t: Time<TDB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TDB>> for Time<TCG>

Source§

fn from(t: Time<TDB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TDB>> for Time<TT>

Source§

fn from(t: Time<TDB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TDB>> for Time<UT>

Source§

fn from(t: Time<TDB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TDB>> for Time<UnixTime>

Source§

fn from(t: Time<TDB>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TT>> for Time<GPS>

Source§

fn from(t: Time<TT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TT>> for Time<JD>

Source§

fn from(t: Time<TT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TT>> for Time<JDE>

Source§

fn from(t: Time<TT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TT>> for Time<MJD>

Source§

fn from(t: Time<TT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TT>> for Time<TAI>

Source§

fn from(t: Time<TT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TT>> for Time<TCB>

Source§

fn from(t: Time<TT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TT>> for Time<TCG>

Source§

fn from(t: Time<TT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TT>> for Time<TDB>

Source§

fn from(t: Time<TT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TT>> for Time<UT>

Source§

fn from(t: Time<TT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<TT>> for Time<UnixTime>

Source§

fn from(t: Time<TT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UT>> for Time<GPS>

Source§

fn from(t: Time<UT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UT>> for Time<JD>

Source§

fn from(t: Time<UT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UT>> for Time<JDE>

Source§

fn from(t: Time<UT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UT>> for Time<MJD>

Source§

fn from(t: Time<UT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UT>> for Time<TAI>

Source§

fn from(t: Time<UT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UT>> for Time<TCB>

Source§

fn from(t: Time<UT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UT>> for Time<TCG>

Source§

fn from(t: Time<UT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UT>> for Time<TDB>

Source§

fn from(t: Time<UT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UT>> for Time<TT>

Source§

fn from(t: Time<UT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UT>> for Time<UnixTime>

Source§

fn from(t: Time<UT>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UnixTime>> for Time<GPS>

Source§

fn from(t: Time<UnixTime>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UnixTime>> for Time<JD>

Source§

fn from(t: Time<UnixTime>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UnixTime>> for Time<JDE>

Source§

fn from(t: Time<UnixTime>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UnixTime>> for Time<MJD>

Source§

fn from(t: Time<UnixTime>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UnixTime>> for Time<TAI>

Source§

fn from(t: Time<UnixTime>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UnixTime>> for Time<TCB>

Source§

fn from(t: Time<UnixTime>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UnixTime>> for Time<TCG>

Source§

fn from(t: Time<UnixTime>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UnixTime>> for Time<TDB>

Source§

fn from(t: Time<UnixTime>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UnixTime>> for Time<TT>

Source§

fn from(t: Time<UnixTime>) -> Self

Converts to this type from the input type.
Source§

impl From<Time<UnixTime>> for Time<UT>

Source§

fn from(t: Time<UnixTime>) -> Self

Converts to this type from the input type.
Source§

impl<S: PartialEq + TimeScale> PartialEq for Time<S>

Source§

fn eq(&self, other: &Time<S>) -> 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<S: PartialOrd + TimeScale> PartialOrd for Time<S>

Source§

fn partial_cmp(&self, other: &Time<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<S: TimeScale> Sub<Quantity<Day>> for Time<S>

Source§

type Output = Time<S>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Days) -> Self::Output

Performs the - operation. Read more
Source§

impl<S: TimeScale> Sub for Time<S>

Source§

type Output = Quantity<Day>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<S: TimeScale> SubAssign<Quantity<Day>> for Time<S>

Source§

fn sub_assign(&mut self, rhs: Days)

Performs the -= operation. Read more
Source§

impl<S: TimeScale> TimeInstant for Time<S>

Source§

type Duration = Quantity<Day>

The duration type used for arithmetic operations.
Source§

fn to_utc(&self) -> Option<DateTime<Utc>>

Convert this time instant to UTC DateTime.
Source§

fn from_utc(datetime: DateTime<Utc>) -> Self

Create a time instant from UTC DateTime.
Source§

fn difference(&self, other: &Self) -> Self::Duration

Compute the difference between two time instants.
Source§

fn add_duration(&self, duration: Self::Duration) -> Self

Add a duration to this time instant.
Source§

fn sub_duration(&self, duration: Self::Duration) -> Self

Subtract a duration from this time instant.
Source§

impl<S: Copy + TimeScale> Copy for Time<S>

Source§

impl<S: TimeScale> StructuralPartialEq for Time<S>

Auto Trait Implementations§

§

impl<S> Freeze for Time<S>

§

impl<S> RefUnwindSafe for Time<S>
where S: RefUnwindSafe,

§

impl<S> Send for Time<S>
where S: Send,

§

impl<S> Sync for Time<S>
where S: Sync,

§

impl<S> Unpin for Time<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for Time<S>

§

impl<S> UnwindSafe for Time<S>
where S: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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.