pub struct SpanCtx<'a> {
pub labels: &'a [(&'static str, &'a str)],
pub spans: &'a [SpanFrame<'a>],
}Expand description
Read-only view of the active scope/span context that
register_typed-style closures receive. Spec 12 § 3.6.
Carries the labels the user has named in obs::scope! plus the span
ancestry (oldest first) for tracing source spans. Keeps two slices
borrowed from caller-owned storage so the bridge never allocates.
Fields§
§labels: &'a [(&'static str, &'a str)]Labels from the active obs::scope! allowlist, outermost first.
spans: &'a [SpanFrame<'a>]Tracing span ancestry, oldest first; empty if this SpanCtx
originates from a non-bridge path.
Implementations§
Source§impl<'a> SpanCtx<'a>
impl<'a> SpanCtx<'a>
Sourcepub const fn empty() -> SpanCtx<'a>
pub const fn empty() -> SpanCtx<'a>
Empty context. Useful for non-bridge call sites that still want
to pass a SpanCtx to a typed promotion closure.
Sourcepub fn label(&self, name: &str) -> Option<&'a str>
pub fn label(&self, name: &str) -> Option<&'a str>
Look up a label by name. Returns the innermost (last) match so nested scopes shadow outer ones.
Trait Implementations§
impl<'a> Copy for SpanCtx<'a>
Auto Trait Implementations§
impl<'a> Freeze for SpanCtx<'a>
impl<'a> RefUnwindSafe for SpanCtx<'a>
impl<'a> Send for SpanCtx<'a>
impl<'a> Sync for SpanCtx<'a>
impl<'a> Unpin for SpanCtx<'a>
impl<'a> UnsafeUnpin for SpanCtx<'a>
impl<'a> UnwindSafe for SpanCtx<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request