Skip to main content

relux_runtime/observe/structured/
skip.rs

1use serde::Deserialize;
2use serde::Serialize;
3use ts_rs::TS;
4
5use super::SourceLocation;
6use super::event::EventSeq;
7use super::span::MarkerEvalDetail;
8use super::span::MarkerEvalKind;
9use super::span::SpanId;
10
11/// Self-contained pointer used by `TestOutcome::Skip` to identify which
12/// marker triggered the skip. `span` is the `marker-eval` span; `event_seq`
13/// is the `BoolCheck` event under it; `location` is the marker source
14/// `{file, line, start, end}` denormalised from the span so consumers can
15/// read the verbatim marker line without hopping through `spans`. The
16/// viewer focuses these at open time and expands ancestors so the markers
17/// tree is unfolded.
18#[derive(Debug, Clone, Serialize, Deserialize, TS)]
19#[cfg_attr(
20    feature = "ts-export",
21    ts(export, export_to = "../../../viewer/src/types/")
22)]
23pub struct SkipRecord {
24    pub span: SpanId,
25    pub event_seq: EventSeq,
26    pub marker_kind: MarkerEvalKind,
27    pub evaluation: MarkerEvalDetail,
28    pub location: Option<SourceLocation>,
29}