#[non_exhaustive]pub struct ExecutionTrace {
pub steps: Vec<ExecutionStep>,
/* private fields */
}Expand description
Complete execution trace containing all steps
#[non_exhaustive]: construct with ExecutionTrace::new or
ExecutionTrace::with_options. steps stays public for reads.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.steps: Vec<ExecutionStep>All execution steps in order
Implementations§
Source§impl ExecutionTrace
impl ExecutionTrace
Sourcepub fn with_options(options: TraceOptions) -> Self
pub fn with_options(options: TraceOptions) -> Self
Empty trace that records according to options.
Sourcepub fn options(&self) -> &TraceOptions
pub fn options(&self) -> &TraceOptions
The capture policy this trace records with.
Sourcepub fn truncated(&self) -> bool
pub fn truncated(&self) -> bool
Whether TraceOptions::max_snapshot_bytes was exceeded, and one or
more executed steps therefore carry message: None, missing mapping
contexts, or both.
The budget is shared across both: with TraceOptions::snapshots off
but TraceOptions::mapping_contexts on, this can still return true
from the mapping-context term alone, even though no step was ever going
to carry a message.
Sourcepub fn add_step(&mut self, step: ExecutionStep)
pub fn add_step(&mut self, step: ExecutionStep)
Add a step to the trace
Sourcepub fn final_message(&self) -> Option<&Message>
pub fn final_message(&self) -> Option<&Message>
Get the final message (from the last executed step)
Returns None when TraceOptions::snapshots is off, or when every
executed step was recorded after the snapshot budget was exceeded.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if execution was successful (no errors in final message)
Degenerates to true when there is no snapshot to inspect — with
TraceOptions::snapshots off, read Message::errors on the message you
passed in instead.
Sourcepub fn executed_count(&self) -> usize
pub fn executed_count(&self) -> usize
Get number of executed steps
Sourcepub fn skipped_count(&self) -> usize
pub fn skipped_count(&self) -> usize
Get number of skipped steps
Trait Implementations§
Source§impl Clone for ExecutionTrace
impl Clone for ExecutionTrace
Source§fn clone(&self) -> ExecutionTrace
fn clone(&self) -> ExecutionTrace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more