[][src]Struct clepsydra::GlobalTime

pub struct GlobalTime {
    pub milli_secs: u64,
    pub peer: PeerID,
    pub event: u64,
}

GlobalTimes are the fundamental timekeeping type in the system.

They have some interesting properties:

  • They are totally ordered.
  • They are assumed globally unique: there's a unique peer-ID component in each.
  • They are issued monotonicaly-increasing: there's an event-counter at the end in case real time moves backwards or stalls.
  • They are issued at each peer, without coordination.
  • They do assume some level of real-time-clock availability on all peers generating them, but those clocks do not need to be very tightly synchronized. Larger skew will imply longer latency on each transaction but will not affect throughput as transactions execute asynchronously and in parallel.

The GlobalTime type is used in a variety of contexts, some of which are wrapped in newtypes to make it a bit less likely to misuse them. They are sometimes called "transaction IDs" or "tids", or "timestamps", or "ts", or "versions", or the ver component of a crate::KeyVer. All these synonyms arise from the OV paper and are reproduced here to attempt to retain similar terminology in each algorithm and protocol message. The various "watermarks" tracking the sets of transactions in each phase across the system are also GlobalTimes.

Fields

milli_secs: u64peer: PeerIDevent: u64

Implementations

impl GlobalTime[src]

pub fn new(peer: PeerID, milli_secs: u64, event: u64) -> GlobalTime[src]

pub fn max_for(peer: PeerID) -> GlobalTime[src]

pub fn time_zero_for(peer: PeerID) -> GlobalTime[src]

pub fn with_milli_sec(&self, milli_secs: u64) -> GlobalTime[src]

pub fn prev_milli_sec(&self) -> GlobalTime[src]

pub fn next_milli_sec(&self) -> GlobalTime[src]

pub fn with_event(&self, event: u64) -> GlobalTime[src]

pub fn prev_event(&self) -> GlobalTime[src]

pub fn next_event(&self) -> GlobalTime[src]

Trait Implementations

impl Clone for GlobalTime[src]

impl Copy for GlobalTime[src]

impl Debug for GlobalTime[src]

impl Default for GlobalTime[src]

impl<'de> Deserialize<'de> for GlobalTime[src]

impl Eq for GlobalTime[src]

impl Hash for GlobalTime[src]

impl Ord for GlobalTime[src]

impl PartialEq<GlobalTime> for GlobalTime[src]

impl PartialOrd<GlobalTime> for GlobalTime[src]

impl Serialize for GlobalTime[src]

impl StructuralEq for GlobalTime[src]

impl StructuralPartialEq for GlobalTime[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DefTraits for T where
    T: Clone + Ord + Default + Debug + Hash + DeserializeOwned + Serialize
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Msg for T where
    T: Serialize + DeserializeOwned + Send + Sync + 'static, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> ValTraits for T where
    T: Clone + Eq + Default + Debug + Hash + DeserializeOwned + Serialize
[src]

impl<T> WithSubscriber for T[src]