pub struct Instant {
pub scale: TimeScale,
pub repr: InstantRepr,
}Expand description
A point in time, always tagged with its TimeScale.
Fields§
§scale: TimeScaleThe time scale this instant is expressed in.
repr: InstantReprThe precision-preserving representation.
Implementations§
Source§impl Instant
impl Instant
Sourcepub fn from_utc_civil(
year: i32,
month: i32,
day: i32,
hour: i32,
minute: i32,
second: f64,
) -> Result<Self, TimeModelError>
pub fn from_utc_civil( year: i32, month: i32, day: i32, hour: i32, minute: i32, second: f64, ) -> Result<Self, TimeModelError>
A UTC Instant from civil-calendar fields.
Marshals (year, month, day, hour, minute, second) through
split_julian_date into the split-Julian-date representation, tagged
TimeScale::Utc. This is the public entry a thin binding calls to build
the epoch argument for the ionosphere/troposphere dispatchers (for
example crate::atmosphere::ionosphere::ionosphere_delay and
crate::atmosphere::ionosphere::klobuchar) without reaching into the
crate-private split internals; it produces the same Instant as the
open-coded split_julian_date + Instant::from_julian_date path.
No leap second is applied: the instant carries the civil fields as given,
the same no-leap contract as split_julian_date. An out-of-day clock
field whose residual leaves the one-day fraction window is rejected by
JulianDateSplit::new.
Source§impl Instant
impl Instant
Sourcepub fn from_julian_date(scale: TimeScale, jd: JulianDateSplit) -> Self
pub fn from_julian_date(scale: TimeScale, jd: JulianDateSplit) -> Self
An instant from a split Julian date in the given scale.
Sourcepub fn from_nanos(scale: TimeScale, nanos: i128) -> Self
pub fn from_nanos(scale: TimeScale, nanos: i128) -> Self
An instant from integer nanoseconds in the given scale.
Sourcepub fn julian_date(&self) -> Option<JulianDateSplit>
pub fn julian_date(&self) -> Option<JulianDateSplit>
The split Julian date, if this instant is stored in that form.
Trait Implementations§
impl Copy for Instant
impl StructuralPartialEq for Instant
Auto Trait Implementations§
impl Freeze for Instant
impl RefUnwindSafe for Instant
impl Send for Instant
impl Sync for Instant
impl Unpin for Instant
impl UnsafeUnpin for Instant
impl UnwindSafe for Instant
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
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.