[][src]Struct ephemeris::Instant

pub struct Instant { /* fields omitted */ }

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]

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]

impl Ord for Instant[src]

impl PartialEq<Instant> for Instant[src]

impl PartialOrd<Instant> for Instant[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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.