pub struct TraceRecorder {
opts: CaptureOptions,
max_steps: usize,
prev_bodies: PreviousBodies,
initial: Option<ContextSnapshot>,
steps: Vec<NodeStep>,
notes: Vec<String>,
truncated: bool,
}Expand description
Accumulates steps while the engine walks a graph.
Created per traced execution and handed to
CompiledGraph::execute_traced;
the engine calls record_step after each node
and the caller then finishes it into a Trace.
Fields§
§opts: CaptureOptions§max_steps: usize§prev_bodies: PreviousBodiesBodies from the previous step, so an unchanged body is not stored once
per node. Cloning Bytes is a refcount bump, not a copy.
initial: Option<ContextSnapshot>§steps: Vec<NodeStep>§notes: Vec<String>§truncated: boolImplementations§
Source§impl TraceRecorder
impl TraceRecorder
Sourcepub fn new(ctx: &Context, opts: CaptureOptions, max_steps: usize) -> Self
pub fn new(ctx: &Context, opts: CaptureOptions, max_steps: usize) -> Self
Starts a recording, capturing the context as it enters the graph.
Sourcepub fn record_step(
&mut self,
node_id: &str,
node_type: &str,
outcome: StepOutcome,
duration: Duration,
edge: EdgeKind,
next_node_id: Option<&str>,
ctx: &Context,
)
pub fn record_step( &mut self, node_id: &str, node_type: &str, outcome: StepOutcome, duration: Duration, edge: EdgeKind, next_node_id: Option<&str>, ctx: &Context, )
Records one node execution. Called by the engine immediately after the plugin returns, while the context is still in hand.
Auto Trait Implementations§
impl !Freeze for TraceRecorder
impl RefUnwindSafe for TraceRecorder
impl Send for TraceRecorder
impl Sync for TraceRecorder
impl Unpin for TraceRecorder
impl UnsafeUnpin for TraceRecorder
impl UnwindSafe for TraceRecorder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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