pub struct ReplayRecorder { /* private fields */ }Expand description
An append-only, capped log of external results for one flow, plus a replay cursor. Recorded during the live run; consumed in order during replay.
Implementations§
Source§impl ReplayRecorder
impl ReplayRecorder
Sourcepub fn record(&mut self, name: &str, args: &[Value], result: &Value)
pub fn record(&mut self, name: &str, args: &[Value], result: &Value)
Append a recorded external result, respecting RECORDING_CAP. Beyond
the cap the result is dropped (replay falls through to fallback).
Sourcepub fn take_recorded(&mut self, name: &str, args: &[Value]) -> Option<Value>
pub fn take_recorded(&mut self, name: &str, args: &[Value]) -> Option<Value>
Replay-cursor lookup: if the next recorded entry matches name + args,
return its result and advance the cursor. On the first mismatch (the
program path changed under us) or exhaustion, mark the recorder diverged
so every subsequent lookup returns None (→ fallback), rather than
feeding misaligned later recordings.
Sourcepub fn reset_cursor(&mut self)
pub fn reset_cursor(&mut self)
Reset the replay cursor and divergence flag to the start of the log, so the recording can drive another replay from the beginning.
Trait Implementations§
Source§impl Clone for ReplayRecorder
impl Clone for ReplayRecorder
Source§fn clone(&self) -> ReplayRecorder
fn clone(&self) -> ReplayRecorder
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 ReplayRecorder
impl Debug for ReplayRecorder
Source§impl Default for ReplayRecorder
impl Default for ReplayRecorder
Source§fn default() -> ReplayRecorder
fn default() -> ReplayRecorder
Returns the “default value” for a type. Read more
Source§impl PartialEq for ReplayRecorder
impl PartialEq for ReplayRecorder
Source§fn eq(&self, other: &ReplayRecorder) -> bool
fn eq(&self, other: &ReplayRecorder) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ReplayRecorder
Auto Trait Implementations§
impl Freeze for ReplayRecorder
impl RefUnwindSafe for ReplayRecorder
impl Send for ReplayRecorder
impl Sync for ReplayRecorder
impl Unpin for ReplayRecorder
impl UnsafeUnpin for ReplayRecorder
impl UnwindSafe for ReplayRecorder
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