[−][src]Struct ephemeris::Instant
An instantaneous point in time along the timeline.
This is explicitly a TAI instant. This means that, among other things, the civil time an instant maps to (a normal calendar date and time) changes over time, as leap seconds are added to the civil clock.
Methods
impl Instant
[src]
pub const MIN: Instant
[src]
Constant for the earliest possible instant.
pub const EPOCH: Instant
[src]
Constant for the epoch instant, that is, '1970-01-01 00:00:00.000000000Z'.
pub const MAX: Instant
[src]
Constant for the last possible instant.
pub fn of_epoch_milli(epoch_milliseconds: i64) -> Instant
[src]
Obtains an Instant using milliseconds since '1970-01-01 00:00:00.000Z'.
The seconds and fractional seconds are calculated from the provided milliseconds.
Parameters
epoch_milliseconds
: the milliseconds since the epoch.
pub fn of_epoch_second(epoch_seconds: i64) -> Instant
[src]
Obtains an Instant using seconds since '1970-01-01 00:00:00Z'.
Parameters
epoch_seconds
: the seconds in the duration.
pub fn of_epoch_second_and_adjustment(
epoch_seconds: i64,
nano_adjustment: i64
) -> Instant
[src]
epoch_seconds: i64,
nano_adjustment: i64
) -> Instant
Obtains an Instant using seconds and an adjustment in nanoseconds since '1970-01-01 00:00:00.000000000Z'.
Parameters
epoch_seconds
: the seconds since the epoch.nano_adjustment
: the adjustment amount from the given second.
Panics
- if the adjusted amount of seconds would be before the minimum instant, or after the maximum instant.
pub fn epoch_second(&self) -> i64
[src]
Gets the number of seconds before or after the epoch.
pub fn nano(&self) -> u32
[src]
Gets the number of nanoseconds farther along the timeline in this instant.
Trait Implementations
impl Clone for Instant
[src]
impl Copy for Instant
[src]
impl Debug for Instant
[src]
impl Default for Instant
[src]
impl Eq for Instant
[src]
impl Hash for Instant
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Instant
[src]
fn cmp(&self, other: &Instant) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Instant> for Instant
[src]
impl PartialOrd<Instant> for Instant
[src]
fn partial_cmp(&self, other: &Instant) -> Option<Ordering>
[src]
fn lt(&self, other: &Instant) -> bool
[src]
fn le(&self, other: &Instant) -> bool
[src]
fn gt(&self, other: &Instant) -> bool
[src]
fn ge(&self, other: &Instant) -> bool
[src]
impl StructuralEq for Instant
[src]
impl StructuralPartialEq for Instant
[src]
Auto Trait Implementations
impl RefUnwindSafe for Instant
impl Send for Instant
impl Sync for Instant
impl Unpin for Instant
impl UnwindSafe for Instant
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,