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]

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]

Formats the value using the given formatter.

impl Clone for HLTimespec
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for HLTimespec
[src]

impl Eq for HLTimespec
[src]

impl PartialEq for HLTimespec
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialOrd for HLTimespec
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

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]

This method returns an Ordering between self and other. Read more

impl Display for HLTimespec
[src]

Formats the value using the given formatter. Read more