Struct datetime::Instant
[−]
[src]
pub struct Instant { /* fields omitted */ }
An instant is an exact point on the timeline, irrespective of time zone or calendar format, with millisecond precision.
Internally, this is represented by a 64-bit integer of seconds, and a 16-bit integer of milliseconds. This means that it will overflow (and thus be unsuitable for) instants past GMT 15:30:08, Sunday 4th December, 292,277,026,596 (yes, that’s a year)
Methods
impl Instant
[src]
fn at(seconds: i64) -> Instant
[src]
Creates a new Instant set to the number of seconds since the Unix epoch, and zero milliseconds.
fn at_ms(seconds: i64, milliseconds: i16) -> Instant
[src]
Creates a new Instant set to the number of seconds since the Unix epoch, along with the number of milliseconds so far this second.
fn now() -> Instant
[src]
Creates a new Instant set to the computer’s current time.
fn at_epoch() -> Instant
[src]
Creates a new Instant set to the Unix epoch.
fn seconds(&self) -> i64
[src]
Returns the number of seconds at this instant
fn milliseconds(&self) -> i16
[src]
Returns the number of milliseconds at this instant
Trait Implementations
impl PartialEq for Instant
[src]
fn eq(&self, __arg_0: &Instant) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Instant) -> bool
[src]
This method tests for !=
.
impl Eq for Instant
[src]
impl PartialOrd for Instant
[src]
fn partial_cmp(&self, __arg_0: &Instant) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Instant) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Instant) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Instant) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Instant) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Instant
[src]
fn cmp(&self, __arg_0: &Instant) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Clone for Instant
[src]
fn clone(&self) -> Instant
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Instant
[src]
impl Debug for Instant
[src]
impl Add<Duration> for Instant
[src]
type Output = Instant
The resulting type after applying the +
operator.
fn add(self, duration: Duration) -> Instant
[src]
Performs the +
operation.