pub struct ReplayCursor { /* private fields */ }Expand description
Dispatcher-side read helper: an in-memory index of the entries loaded
from a ReplayStore for one Run, plus the per-(step_ref, input_hash)
occurrence counter the dispatcher bumps at each call.
next_occurrence and find are the two operations the dispatcher
performs per attempt: the former advances the counter and returns
the current occurrence value, the latter tries to resolve
(step_ref, input_hash, occurrence) against the loaded entries.
Implementations§
Source§impl ReplayCursor
impl ReplayCursor
Sourcepub fn from_entries(entries: Vec<ReplayEntry>) -> Self
pub fn from_entries(entries: Vec<ReplayEntry>) -> Self
Build a cursor from a run’s worth of entries. Entries whose
step_output_json fails to decode are silently skipped after a
tracing::warn! — a corrupt row must not prevent the rest of the
run from replaying.
Sourcepub fn next_occurrence(&mut self, step_ref: &str, input_hash: &str) -> u32
pub fn next_occurrence(&mut self, step_ref: &str, input_hash: &str) -> u32
Advance the occurrence counter for (step_ref, input_hash) and
return the value for THIS call (0 on the first call, 1 on the
second, and so on). Consumes one occurrence: two consecutive calls
with the same key return 0 then 1.
Sourcepub fn find(
&self,
step_ref: &str,
input_hash: &str,
occurrence: u32,
) -> Option<Value>
pub fn find( &self, step_ref: &str, input_hash: &str, occurrence: u32, ) -> Option<Value>
Look up a stored DispatchOutcome::Pass value by
(step_ref, input_hash, occurrence). None = miss (no matching
row was appended for this triple).
Trait Implementations§
Source§impl Debug for ReplayCursor
impl Debug for ReplayCursor
Source§impl Default for ReplayCursor
impl Default for ReplayCursor
Source§fn default() -> ReplayCursor
fn default() -> ReplayCursor
Auto Trait Implementations§
impl Freeze for ReplayCursor
impl RefUnwindSafe for ReplayCursor
impl Send for ReplayCursor
impl Sync for ReplayCursor
impl Unpin for ReplayCursor
impl UnsafeUnpin for ReplayCursor
impl UnwindSafe for ReplayCursor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more