[−][src]Struct hybrid_clocks::Timestamp
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 withb
, ora
is part ofb
's causal history, or vica-versa.
Fields
epoch: u32
An epoch counter.
time: T
The Wall-clock time as returned by the clock source.
count: u32
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<WallMST>
[src]
impl Timestamp<WallNST>
[src]
pub fn write_bytes<W: Write>(&self, wr: W) -> Result<(), Error>
[src]
pub fn to_bytes(&self) -> [u8; 16]
[src]
pub fn read_bytes<R: Read>(r: R) -> Result<Self, Error>
[src]
pub fn from_bytes(bytes: [u8; 16]) -> Self
[src]
impl<T> Timestamp<T>
[src]
Trait Implementations
impl<T: PartialEq> PartialEq<Timestamp<T>> for Timestamp<T>
[src]
impl<T: Clone> Clone for Timestamp<T>
[src]
fn clone(&self) -> Timestamp<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Ord> Ord for Timestamp<T>
[src]
fn cmp(&self, other: &Timestamp<T>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<T: Eq> Eq for Timestamp<T>
[src]
impl<T: Copy> Copy for Timestamp<T>
[src]
impl<T: PartialOrd> PartialOrd<Timestamp<T>> for Timestamp<T>
[src]
fn partial_cmp(&self, other: &Timestamp<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &Timestamp<T>) -> bool
[src]
fn le(&self, other: &Timestamp<T>) -> bool
[src]
fn gt(&self, other: &Timestamp<T>) -> bool
[src]
fn ge(&self, other: &Timestamp<T>) -> bool
[src]
impl<T: Debug> Debug for Timestamp<T>
[src]
impl<T: Display> Display for Timestamp<T>
[src]
impl<T: Hash> Hash for Timestamp<T>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,