pub struct ReplayRecorder { /* private fields */ }Expand description
Stateful recorder that accumulates extension runtime events during a
dispatch cycle and produces a deterministic ReplayTraceBundle.
Events are pushed in arrival order; the recorder’s finish
method canonicalizes ordering, applies the budget gate, and builds the
diagnostic snapshot.
Implementations§
Source§impl ReplayRecorder
impl ReplayRecorder
Sourcepub fn new(trace_id: impl Into<String>, config: ReplayLaneConfig) -> Self
pub fn new(trace_id: impl Into<String>, config: ReplayLaneConfig) -> Self
Create a new recorder for a single dispatch cycle.
Sourcepub const fn logical_clock(&self) -> u64
pub const fn logical_clock(&self) -> u64
Current logical clock value.
Sourcepub const fn event_count(&self) -> u64
pub const fn event_count(&self) -> u64
Number of events recorded so far.
Sourcepub fn record(
&mut self,
extension_id: impl Into<String>,
request_id: impl Into<String>,
kind: ReplayEventKind,
attributes: BTreeMap<String, String>,
)
pub fn record( &mut self, extension_id: impl Into<String>, request_id: impl Into<String>, kind: ReplayEventKind, attributes: BTreeMap<String, String>, )
Record an event at the current logical clock.
Sourcepub fn record_scheduled(
&mut self,
extension_id: impl Into<String>,
request_id: impl Into<String>,
attributes: BTreeMap<String, String>,
)
pub fn record_scheduled( &mut self, extension_id: impl Into<String>, request_id: impl Into<String>, attributes: BTreeMap<String, String>, )
Record a Scheduled event.
Sourcepub fn record_queue_accepted(
&mut self,
extension_id: impl Into<String>,
request_id: impl Into<String>,
attributes: BTreeMap<String, String>,
)
pub fn record_queue_accepted( &mut self, extension_id: impl Into<String>, request_id: impl Into<String>, attributes: BTreeMap<String, String>, )
Record a QueueAccepted event.
Sourcepub fn record_policy_decision(
&mut self,
extension_id: impl Into<String>,
request_id: impl Into<String>,
attributes: BTreeMap<String, String>,
)
pub fn record_policy_decision( &mut self, extension_id: impl Into<String>, request_id: impl Into<String>, attributes: BTreeMap<String, String>, )
Record a PolicyDecision event.
Sourcepub fn record_cancelled(
&mut self,
extension_id: impl Into<String>,
request_id: impl Into<String>,
attributes: BTreeMap<String, String>,
)
pub fn record_cancelled( &mut self, extension_id: impl Into<String>, request_id: impl Into<String>, attributes: BTreeMap<String, String>, )
Record a Cancelled event.
Sourcepub fn record_retried(
&mut self,
extension_id: impl Into<String>,
request_id: impl Into<String>,
attributes: BTreeMap<String, String>,
)
pub fn record_retried( &mut self, extension_id: impl Into<String>, request_id: impl Into<String>, attributes: BTreeMap<String, String>, )
Record a Retried event.
Sourcepub fn record_completed(
&mut self,
extension_id: impl Into<String>,
request_id: impl Into<String>,
attributes: BTreeMap<String, String>,
)
pub fn record_completed( &mut self, extension_id: impl Into<String>, request_id: impl Into<String>, attributes: BTreeMap<String, String>, )
Record a Completed event.
Sourcepub fn record_failed(
&mut self,
extension_id: impl Into<String>,
request_id: impl Into<String>,
attributes: BTreeMap<String, String>,
)
pub fn record_failed( &mut self, extension_id: impl Into<String>, request_id: impl Into<String>, attributes: BTreeMap<String, String>, )
Record a Failed event.
Sourcepub fn finish(
self,
observation: ReplayCaptureObservation,
) -> Result<ReplayLaneResult, ReplayTraceValidationError>
pub fn finish( self, observation: ReplayCaptureObservation, ) -> Result<ReplayLaneResult, ReplayTraceValidationError>
Finalize the recording: canonicalize event ordering, apply budget gate, and build the diagnostic snapshot.
The observation provides runtime telemetry needed for budget gating.
§Errors
Returns an error if the trace bundle fails validation.
Sourcepub fn finish_and_compare(
self,
observation: ReplayCaptureObservation,
reference: &ReplayTraceBundle,
) -> Result<(ReplayLaneResult, ReplayComparisonResult), ReplayTraceValidationError>
pub fn finish_and_compare( self, observation: ReplayCaptureObservation, reference: &ReplayTraceBundle, ) -> Result<(ReplayLaneResult, ReplayComparisonResult), ReplayTraceValidationError>
Finalize and compare against a reference bundle.
Returns the lane result together with a comparison result that includes the first divergence (if any) and derived root-cause hints.
§Errors
Returns an error if either bundle fails validation.
Trait Implementations§
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
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