pub struct ManualClock { /* private fields */ }Expand description
An explicitly-advanced logical clock for deterministic replay and backtests.
The watermark only ever moves forward: advance_to
ignores regressions, guaranteeing monotonicity even under concurrent
advances. Clones share the same underlying watermark, so a harness can hold
one handle while a stream operator holds another.
Implementations§
Source§impl ManualClock
impl ManualClock
Sourcepub fn new() -> Self
pub fn new() -> Self
A new clock at LogicalTime::ZERO.
Sourcepub fn at(start: LogicalTime) -> Self
pub fn at(start: LogicalTime) -> Self
A new clock starting at start.
Sourcepub fn advance_to(&self, target: LogicalTime)
pub fn advance_to(&self, target: LogicalTime)
Advance the watermark to target. Monotonic — a target at or below the
current watermark is a no-op.
Sourcepub fn advance_by(&self, delta: LogicalTime)
pub fn advance_by(&self, delta: LogicalTime)
Advance the watermark by delta.
Sourcepub fn watermark(&self) -> LogicalTime
pub fn watermark(&self) -> LogicalTime
The current watermark.
Trait Implementations§
Source§impl Clock for ManualClock
impl Clock for ManualClock
Source§fn now(&self) -> LogicalTime
fn now(&self) -> LogicalTime
The current logical instant.
Source§impl Clone for ManualClock
impl Clone for ManualClock
Source§fn clone(&self) -> ManualClock
fn clone(&self) -> ManualClock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ManualClock
impl Debug for ManualClock
Source§impl Default for ManualClock
impl Default for ManualClock
Source§fn default() -> ManualClock
fn default() -> ManualClock
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ManualClock
impl RefUnwindSafe for ManualClock
impl Send for ManualClock
impl Sync for ManualClock
impl Unpin for ManualClock
impl UnsafeUnpin for ManualClock
impl UnwindSafe for ManualClock
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