pub struct ScopeFrame { /* private fields */ }Expand description
One frame on the per-task / per-thread scope stack.
Implementations§
Source§impl ScopeFrame
impl ScopeFrame
Sourcepub fn new(fields: Vec<ScopeField>, kind: ScopeKind, tail_capacity: u16) -> Self
pub fn new(fields: Vec<ScopeField>, kind: ScopeKind, tail_capacity: u16) -> Self
Construct a frame with the supplied declared fields and tail buffer capacity.
Sourcepub fn set_traceparent_sampled(&mut self, sampled: bool)
pub fn set_traceparent_sampled(&mut self, sampled: bool)
Update the inbound traceparent.sampled decision (set by the
HTTP middleware at request entry). Spec 13 § 6.
Sourcepub fn set_span_identity(&mut self, name: &'static str, target: &'static str)
pub fn set_span_identity(&mut self, name: &'static str, target: &'static str)
Set the bridged tracing span identity for obs::SpanTrace
rendering. Spec 13 § 9.
Sourcepub fn traceparent_sampled(&self) -> Option<bool>
pub fn traceparent_sampled(&self) -> Option<bool>
Inbound traceparent.sampled decision, when set.
Sourcepub fn fields(&self) -> &[ScopeField]
pub fn fields(&self) -> &[ScopeField]
Read-only view of the declared fields.
Sourcepub fn seen_error(&self) -> bool
pub fn seen_error(&self) -> bool
true if the scope has observed an >= ERROR envelope.
Sourcepub fn mark_error(&mut self)
pub fn mark_error(&mut self)
Mark this frame’s tail buffer as needing flush.
Sourcepub fn tail_capacity(&self) -> u16
pub fn tail_capacity(&self) -> u16
Capacity of the tail buffer (in envelopes).
Sourcepub fn push_tail(&mut self, env: ObsEnvelope)
pub fn push_tail(&mut self, env: ObsEnvelope)
Push an envelope onto the ring buffer. No-op for Context.
Sourcepub fn drain_tail(&mut self) -> Vec<ObsEnvelope>
pub fn drain_tail(&mut self) -> Vec<ObsEnvelope>
Drain and return the buffered envelopes (callers flush on scope-end-with-error).
Sourcepub fn tail_snapshot(&self) -> Vec<ObsEnvelope>
pub fn tail_snapshot(&self) -> Vec<ObsEnvelope>
Snapshot of currently-buffered envelopes (test-only).
Sourcepub fn as_span_frame(&self) -> Option<SpanFrame<'_>>
pub fn as_span_frame(&self) -> Option<SpanFrame<'_>>
Render the frame as a SpanFrame for SpanTrace.
Trait Implementations§
Source§impl Clone for ScopeFrame
impl Clone for ScopeFrame
Source§fn clone(&self) -> ScopeFrame
fn clone(&self) -> ScopeFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more