pub struct ReplayClock { /* private fields */ }Expand description
A deterministic replay clock — the only WASM clock (W12).
Yields Instants from a recorded timeline. Each call to tick()
advances to the next recorded Instant. When the timeline is
exhausted, the clock returns the last Instant (or fails closed
if the timeline was empty).
Implementations§
Source§impl ReplayClock
impl ReplayClock
Sourcepub fn new(timeline: ReplayTimeline) -> Self
pub fn new(timeline: ReplayTimeline) -> Self
Create a replay clock from a timeline.
Sourcepub fn with_exhausted_policy(self, policy: ExhaustedPolicy) -> Self
pub fn with_exhausted_policy(self, policy: ExhaustedPolicy) -> Self
Set the exhausted policy.
Sourcepub fn tick(&mut self) -> Result<Instant, String>
pub fn tick(&mut self) -> Result<Instant, String>
Advance to the next Instant in the timeline. Returns the next Instant, or an error string if exhausted and FailClosed.
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
Is the clock at the end of the timeline?
Sourcepub fn current_payload(&self) -> Option<&Value>
pub fn current_payload(&self) -> Option<&Value>
Get the payload at the current cursor position (before tick).
Trait Implementations§
Source§impl Clone for ReplayClock
impl Clone for ReplayClock
Auto Trait Implementations§
impl Freeze for ReplayClock
impl RefUnwindSafe for ReplayClock
impl Send for ReplayClock
impl Sync for ReplayClock
impl Unpin for ReplayClock
impl UnsafeUnpin for ReplayClock
impl UnwindSafe for ReplayClock
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