Skip to main content

ScopeFrame

Struct ScopeFrame 

Source
pub struct ScopeFrame { /* private fields */ }
Expand description

One frame on the per-task / per-thread scope stack.

Implementations§

Source§

impl ScopeFrame

Source

pub fn new( fields: Vec<ScopeField>, kind: ScopeKind, tail_capacity: u16, ) -> ScopeFrame

Construct a frame with the supplied declared fields and tail buffer capacity.

Source

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.

Source

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.

Source

pub fn traceparent_sampled(&self) -> Option<bool>

Inbound traceparent.sampled decision, when set.

Source

pub fn fields(&self) -> &[ScopeField]

Read-only view of the declared fields.

Source

pub fn kind(&self) -> ScopeKind

Frame kind.

Source

pub fn seen_error(&self) -> bool

true if the scope has observed an >= ERROR envelope.

Source

pub fn mark_error(&mut self)

Mark this frame’s tail buffer as needing flush.

Source

pub fn tail_capacity(&self) -> u16

Capacity of the tail buffer (in envelopes).

Source

pub fn push_tail(&mut self, env: ObsEnvelope)

Push an envelope onto the ring buffer. No-op for Context.

Source

pub fn drain_tail(&mut self) -> Vec<ObsEnvelope>

Drain and return the buffered envelopes (callers flush on scope-end-with-error).

Source

pub fn tail_snapshot(&self) -> Vec<ObsEnvelope>

Snapshot of currently-buffered envelopes (test-only).

Source

pub fn as_span_frame(&self) -> Option<SpanFrame<'_>>

Render the frame as a SpanFrame for SpanTrace.

Trait Implementations§

Source§

impl Clone for ScopeFrame

Source§

fn clone(&self) -> ScopeFrame

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScopeFrame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.