[][src]Struct utsl_hybrid_clocks::Timestamp

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

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

time: T

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

count: u16

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

Implementations

impl Timestamp<WallMST>[src]

pub fn to_bytes(&self) -> [u8; 8][src]

pub fn from_bytes(bytes: [u8; 8]) -> Self[src]

pub fn to_u64(&self) -> u64[src]

pub fn from_u64(t: u64) -> Self[src]

impl<T> Timestamp<T>[src]

pub fn time_into<U: From<T>>(self) -> Timestamp<U>[src]

Trait Implementations

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

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

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

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

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

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

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

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

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

impl<T> StructuralEq for Timestamp<T>[src]

impl<T> StructuralPartialEq for Timestamp<T>[src]

Auto Trait Implementations

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

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

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

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

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

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> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.