pub struct CapturedSpan {
pub id: u64,
pub name: &'static str,
pub target: &'static str,
pub parent: Option<u64>,
pub parent_name: Option<&'static str>,
pub declared: Vec<&'static str>,
pub initial: Map<String, Value>,
pub recorded: Vec<(String, Value)>,
pub follows_from: Vec<u64>,
}test-utils only.Expand description
One span as TraceCapture saw it.
Fields§
§id: u64The span’s id, unique while the span is open.
name: &'static strThe span’s name.
target: &'static strThe span’s target.
parent: Option<u64>The explicit parent, or the current span for a contextual span.
parent_name: Option<&'static str>The parent’s name.
declared: Vec<&'static str>Every field the span declares, in declaration order.
initial: Map<String, Value>The values given when the span was created.
recorded: Vec<(String, Value)>Every value recorded later, in order, repeats included.
follows_from: Vec<u64>The ids this span follows from.
Implementations§
Source§impl CapturedSpan
impl CapturedSpan
Sourcepub fn value(&self, field: &str) -> Option<&Value>
pub fn value(&self, field: &str) -> Option<&Value>
The latest value of field: its last recording, else its initial value.
Sourcepub fn text(&self, field: &str) -> Option<String>
pub fn text(&self, field: &str) -> Option<String>
Self::value as text: a string as it is, anything else as JSON.
Sourcepub fn u64(&self, field: &str) -> Option<u64>
pub fn u64(&self, field: &str) -> Option<u64>
The latest value of field when it is an unsigned integer.
Sourcepub fn record_count(&self, field: &str) -> usize
pub fn record_count(&self, field: &str) -> usize
How many times field was recorded after creation.
Sourcepub fn values(&self) -> Map<String, Value>
pub fn values(&self) -> Map<String, Value>
The initial values with every later recording applied in order.
Sourcepub fn summary(&self) -> Value
pub fn summary(&self) -> Value
The span without its id, which differs between runs: name, target,
parent name, declared fields and Self::values.
Trait Implementations§
Source§impl Clone for CapturedSpan
impl Clone for CapturedSpan
Source§fn clone(&self) -> CapturedSpan
fn clone(&self) -> CapturedSpan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more