pub struct UTC;Expand description
Coordinated Universal Time.
Leap-second-aware civil scale. Time<UTC> stores a continuous instant;
leap-second interpretation is computed on demand from the UTC-TAI
segment table. Raw-axis arithmetic acts on that stored instant.
§Storage invariant
Time<UTC> and Time<TAI> store the same continuous instant for
the same physical event. Scale conversion between them is therefore a
numeric no-op at the storage layer.
UTC participates in CoordinateScale, so Time<UTC> exposes the
same raw J2000/JD/MJD instant-axis helpers and second-based arithmetic
as the other built-in scales. Those operations act on the stored
continuous instant, not on a leap-second-labelled civil clock.
UTC still does not implement ContinuousScale. Generic code that
wants a scale with no civil semantics should keep using that stricter
bound; generic code that merely needs a raw coordinate axis can use
CoordinateScale.
§Authoritative UTC API
Use the civil layer for any operation that depends on the UTC-TAI offset (i.e., leap seconds):
crate::Time::<UTC>::from_chrono/crate::Time::try_from_chrono/crate::Time::try_to_chrono- Unix time:
time.try_to::<crate::Unix>()returns acrate::UnixTime
Trait Implementations§
Source§impl<SrcF: TimeFormat> ConversionTarget<UT1, SrcF> for UTC
impl<SrcF: TimeFormat> ConversionTarget<UT1, SrcF> for UTC
Source§impl<SrcF: TimeFormat> ConversionTarget<UTC, SrcF> for UT1
impl<SrcF: TimeFormat> ConversionTarget<UTC, SrcF> for UT1
Source§impl FormatForScale<UTC> for Unix
impl FormatForScale<UTC> for Unix
fn try_from_time<Fin: TimeFormat>( time: Time<UTC, Fin>, ctx: &TimeContext, ) -> Result<Second, ConversionError>
fn try_into_time( raw: Second, ctx: &TimeContext, ) -> Result<Time<UTC, Self>, ConversionError>
Source§impl Ord for UTC
impl Ord for UTC
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for UTC
impl PartialOrd for UTC
impl CoordinateScale for UTC
impl Copy for UTC
impl Eq for UTC
impl StructuralPartialEq for UTC
Auto Trait Implementations§
impl Freeze for UTC
impl RefUnwindSafe for UTC
impl Send for UTC
impl Sync for UTC
impl Unpin for UTC
impl UnsafeUnpin for UTC
impl UnwindSafe for UTC
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<S1, S2, SrcF> ContextConversionTarget<S1, SrcF> for S2
impl<S1, S2, SrcF> ContextConversionTarget<S1, SrcF> for S2
type Output = Time<S2, SrcF>
fn convert_with( src: Time<S1, SrcF>, ctx: &TimeContext, ) -> Result<<S2 as ContextConversionTarget<S1, SrcF>>::Output, ConversionError>
Source§impl<S1, S2, SrcF> ConversionTarget<S1, SrcF> for S2
impl<S1, S2, SrcF> ConversionTarget<S1, SrcF> for S2
type Output = Time<S2, SrcF>
fn try_convert( src: Time<S1, SrcF>, ) -> Result<<S2 as ConversionTarget<S1, SrcF>>::Output, ConversionError>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.