[−][src]Struct clepsydra::GlobalTime
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
GlobalTime
s.
Fields
milli_secs: u64
peer: PeerID
event: 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]
pub fn clone(&self) -> GlobalTime
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for GlobalTime
[src]
impl Debug for GlobalTime
[src]
impl Default for GlobalTime
[src]
pub fn default() -> GlobalTime
[src]
impl<'de> Deserialize<'de> for GlobalTime
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for GlobalTime
[src]
impl Hash for GlobalTime
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for GlobalTime
[src]
pub fn cmp(&self, other: &GlobalTime) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<GlobalTime> for GlobalTime
[src]
pub fn eq(&self, other: &GlobalTime) -> bool
[src]
pub fn ne(&self, other: &GlobalTime) -> bool
[src]
impl PartialOrd<GlobalTime> for GlobalTime
[src]
pub fn partial_cmp(&self, other: &GlobalTime) -> Option<Ordering>
[src]
pub fn lt(&self, other: &GlobalTime) -> bool
[src]
pub fn le(&self, other: &GlobalTime) -> bool
[src]
pub fn gt(&self, other: &GlobalTime) -> bool
[src]
pub fn ge(&self, other: &GlobalTime) -> bool
[src]
impl Serialize for GlobalTime
[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for GlobalTime
[src]
impl StructuralPartialEq for GlobalTime
[src]
Auto Trait Implementations
impl RefUnwindSafe for GlobalTime
[src]
impl Send for GlobalTime
[src]
impl Sync for GlobalTime
[src]
impl Unpin for GlobalTime
[src]
impl UnwindSafe for GlobalTime
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DefTraits for T where
T: Clone + Ord + Default + Debug + Hash + DeserializeOwned + Serialize,
[src]
T: Clone + Ord + Default + Debug + Hash + DeserializeOwned + Serialize,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Msg for T where
T: Serialize + DeserializeOwned + Send + Sync + 'static,
[src]
T: Serialize + DeserializeOwned + Send + Sync + 'static,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> ValTraits for T where
T: Clone + Eq + Default + Debug + Hash + DeserializeOwned + Serialize,
[src]
T: Clone + Eq + Default + Debug + Hash + DeserializeOwned + Serialize,
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,