Struct hybrid_clocks::Timestamp [] [src]

pub struct Timestamp<T> {
    pub epoch: u32,
    pub time: T,
    pub count: u32,
}

A value that represents a logical timestamp.

These allow us to describe at least a partial ordering over events, in the same style as Lamport Clocks. In summary, if a < b then we can say that a logically happens-before b. Because they are scalar values, they can't be used to tell between whether:

  • a happenned concurrently with b, or
  • a is part of b's causal history, or vica-versa.

Fields

An epoch counter.

The wall-clock time as returned by the clock source.

A Lamport clock used to disambiguate events that are given the same wall-clock time. This is reset whenever time is incremented.

Methods

impl Timestamp<WallT>
[src]

[src]

[src]

Trait Implementations

impl<T: Debug> Debug for Timestamp<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: Clone> Clone for Timestamp<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Copy> Copy for Timestamp<T>
[src]

impl<T: PartialEq> PartialEq for Timestamp<T>
[src]

[src]

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

[src]

This method tests for !=.

impl<T: Eq> Eq for Timestamp<T>
[src]

impl<T: PartialOrd> PartialOrd for Timestamp<T>
[src]

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

impl<T: Ord> Ord for Timestamp<T>
[src]

[src]

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

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<T: Hash> Hash for Timestamp<T>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: Display> Display for Timestamp<T>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T> Send for Timestamp<T> where
    T: Send

impl<T> Sync for Timestamp<T> where
    T: Sync