Struct hybrid_clocks::Clock
[−]
[src]
pub struct Clock<S: ClockSource> { // some fields omitted }
The main clock type.
Methods
impl Clock<Wall>
[src]
impl<S: ClockSource> Clock<S>
[src]
fn new(src: S) -> Self
Creates a clock with src
as the time provider.
fn new_with_max_diff(src: S, diff: S::Delta) -> Self
Creates a clock with src
as the time provider, and diff
as how far
in the future we don't mind seeing updates from.
fn set_epoch(&mut self, epoch: u32)
Used to create a new "epoch" of clock times, mostly useful as a manual override when a cluster member has skewed the clock time far into the future.
fn now(&mut self) -> Timestamp<S::Time>
Creates a unique monotonic timestamp suitable for annotating messages we send.
fn observe(&mut self, msg: &Timestamp<S::Time>) -> Result<(), Error>
Accepts a timestamp from an incoming message, and updates the clock
so that further calls to now
will always return a timestamp that
happens-after
either locally generated timestamps or that of the
input message. Returns an Error iff the delta from our local lock to
the observed timestamp is greater than our configured limit.