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 ContextConversionTarget<UTC> for Unix
impl ContextConversionTarget<UTC> for Unix
type Output = EncodedTime<UTC, Unix>
fn convert_with( src: Time<UTC>, ctx: &TimeContext, ) -> Result<<Unix as ContextConversionTarget<UTC>>::Output, ConversionError>
Source§impl ConversionTarget<UT1> for UTC
impl ConversionTarget<UT1> for UTC
Source§impl ConversionTarget<UTC> for UT1
impl ConversionTarget<UTC> for UT1
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
Source§impl RepresentationForScale<UTC> for Unix
impl RepresentationForScale<UTC> for Unix
fn try_from_time( time: Time<UTC>, ctx: &TimeContext, ) -> Result<Quantity<Second>, ConversionError>
fn try_into_time( raw: Quantity<Second>, ctx: &TimeContext, ) -> Result<Time<UTC>, ConversionError>
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<S1, S2> ContextConversionTarget<S1> for S2
impl<S1, S2> ContextConversionTarget<S1> for S2
type Output = Time<S2>
fn convert_with( src: Time<S1>, ctx: &TimeContext, ) -> Result<<S2 as ContextConversionTarget<S1>>::Output, ConversionError>
Source§impl<S1, S2> ConversionTarget<S1> for S2
impl<S1, S2> ConversionTarget<S1> for S2
type Output = Time<S2>
fn try_convert( src: Time<S1>, ) -> Result<<S2 as ConversionTarget<S1>>::Output, ConversionError>
Source§impl<S1, S2> InfallibleConversionTarget<S1> for S2
impl<S1, S2> InfallibleConversionTarget<S1> for S2
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.