pub struct Span {
pub kind: &'static str,
pub ordinal: usize,
pub start: Stamp,
pub stages: Vec<Stage>,
/* private fields */
}Expand description
Caller-labeled sequence of explicit evaluation boundaries.
A span is submitted to thread-local storage only by Span::finish. Dropping
it without finishing discards its report; finishing adds no implicit boundary.
Fields§
§kind: &'static strCaller-provided category, such as setup, a round, or settlement.
ordinal: usizeCaller-provided index; this type imposes no numbering convention.
start: StampClock and allocation readings captured when the span was constructed.
stages: Vec<Stage>Intervals recorded in mark order; a span may contain no marks.
Implementations§
Source§impl Span
impl Span
Sourcepub fn new(kind: &'static str, ordinal: usize) -> Self
pub fn new(kind: &'static str, ordinal: usize) -> Self
Capture the starting boundary and create an empty, unsubmitted span.
Clock-query failure panics. The category and ordinal are retained as metadata only; no engine, scope or evaluated value is retained.
Sourcepub fn enter(&mut self, stage: EventStage)
pub fn enter(&mut self, stage: EventStage)
Publish entry before the named operation. Marks instead label completed intervals and must never be interpreted as an operation’s start. An installed sink adds bounded diagnostic I/O; without one this is inert.
Sourcepub fn mark(&mut self, name: &'static str)
pub fn mark(&mut self, name: &'static str)
Capture a boundary and append the interval since the preceding boundary.
Appending may grow the stage vector after the captured endpoint; that recording work falls inside a later interval if another mark follows. Clock-query failure panics before appending a stage.