Struct rotor::Time
[−]
[src]
pub struct Time(_);
The current time
This value is similar to (and directly derived from) the
time::SteadyTime
. But it has three important properties:
- It has a millisecond precision
- It's size is 8 bytes (SteadyTime is 16 bytes)
- It supports math with
std::time::Duration
(more future-proof)
The size of the value is important because we are going to have a lot of timeouts and lots of timestamps stored inside the state machines.
Precision of millisecond is good enough, and even better for our use case as it allows faster comparison and more frequent matches.
Warning: when adding a duration that is not a multiple of a millisecond we truncate (i.e. floor) the duration value. We may change this in future. Note that for timeouts this works well enough, as mio already bumps the timeout to at least a millisecond ahead.
Methods
impl Time
[src]
Trait Implementations
impl Ord for Time
[src]
fn cmp(&self, __arg_0: &Time) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl PartialOrd for Time
[src]
fn partial_cmp(&self, __arg_0: &Time) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Time) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Time) -> bool
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: &Time) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Time) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Eq for Time
[src]
impl PartialEq for Time
[src]
fn eq(&self, __arg_0: &Time) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Time) -> bool
This method tests for !=
.
impl Copy for Time
[src]
impl Clone for Time
[src]
fn clone(&self) -> Time
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more