Struct hlc::HLTimespec
[−]
[src]
pub struct HLTimespec { /* fields omitted */ }
The HLTimespec
type stores a hybrid logical timestamp (also called
timespec for symmetry with time::Timespec).
Such a timestamp is comprised of an "ordinary" wall time and a logical component. Timestamps are compared by wall time first, logical second.
Examples
use hlc::HLTimespec; let early = HLTimespec::new(1, 0, 0); let middle = HLTimespec::new(1, 1, 0); let late = HLTimespec::new(1, 1, 1); assert!(early < middle && middle < late);
Methods
impl HLTimespec
[src]
fn new(s: i64, ns: i32, l: u16) -> HLTimespec
Creates a new hybrid logical timestamp with the given seconds, nanoseconds, and logical ticks.
Examples
use hlc::HLTimespec; let ts = HLTimespec::new(1, 2, 3); assert_eq!(format!("{}", ts), "1.2+3");
Trait Implementations
impl Debug for HLTimespec
[src]
impl Clone for HLTimespec
[src]
fn clone(&self) -> HLTimespec
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
impl Copy for HLTimespec
[src]
impl Eq for HLTimespec
[src]
impl PartialEq for HLTimespec
[src]
fn eq(&self, __arg_0: &HLTimespec) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &HLTimespec) -> bool
This method tests for !=
.
impl PartialOrd for HLTimespec
[src]
fn partial_cmp(&self, __arg_0: &HLTimespec) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &HLTimespec) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &HLTimespec) -> 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: &HLTimespec) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &HLTimespec) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for HLTimespec
[src]
fn cmp(&self, __arg_0: &HLTimespec) -> Ordering
This method returns an Ordering
between self
and other
. Read more