pub struct HybridTimestamp {
pub physical: u64,
pub logical: u32,
pub node_id: String,
}Expand description
A timestamp from a hybrid logical clock.
Fields§
§physical: u64§logical: u32§node_id: StringImplementations§
Source§impl HybridTimestamp
impl HybridTimestamp
Sourcepub fn new(physical: u64, logical: u32, node_id: impl Into<String>) -> Self
pub fn new(physical: u64, logical: u32, node_id: impl Into<String>) -> Self
Create a new hybrid timestamp.
Sourcepub fn compare(&self, other: &HybridTimestamp) -> Ordering
pub fn compare(&self, other: &HybridTimestamp) -> Ordering
Compare with another timestamp.
Sourcepub fn is_before(&self, other: &HybridTimestamp) -> bool
pub fn is_before(&self, other: &HybridTimestamp) -> bool
Check if this timestamp is before another.
Sourcepub fn is_after(&self, other: &HybridTimestamp) -> bool
pub fn is_after(&self, other: &HybridTimestamp) -> bool
Check if this timestamp is after another.
Sourcepub fn to_sortable(&self) -> u128
pub fn to_sortable(&self) -> u128
Convert to a sortable u128 value.
Trait Implementations§
Source§impl Clone for HybridTimestamp
impl Clone for HybridTimestamp
Source§fn clone(&self) -> HybridTimestamp
fn clone(&self) -> HybridTimestamp
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HybridTimestamp
impl Debug for HybridTimestamp
Source§impl<'de> Deserialize<'de> for HybridTimestamp
impl<'de> Deserialize<'de> for HybridTimestamp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for HybridTimestamp
impl Ord for HybridTimestamp
Source§impl PartialEq for HybridTimestamp
impl PartialEq for HybridTimestamp
Source§impl PartialOrd for HybridTimestamp
impl PartialOrd for HybridTimestamp
Source§impl Serialize for HybridTimestamp
impl Serialize for HybridTimestamp
impl Eq for HybridTimestamp
impl StructuralPartialEq for HybridTimestamp
Auto Trait Implementations§
impl Freeze for HybridTimestamp
impl RefUnwindSafe for HybridTimestamp
impl Send for HybridTimestamp
impl Sync for HybridTimestamp
impl Unpin for HybridTimestamp
impl UnsafeUnpin for HybridTimestamp
impl UnwindSafe for HybridTimestamp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.