pub struct ObsTraceCtx {
pub trace_id: String,
pub span_id: String,
pub flags: String,
pub tracestate: String,
}Expand description
Parsed W3C trace context.
Fields are stored as the canonical lowercase-hex strings the W3C
traceparent header uses. trace_id is 32 hex chars, span_id is
16 hex chars, flags is 2 hex chars (00 = unsampled, 01 =
sampled).
Fields§
§trace_id: String32-character hex trace id.
span_id: String16-character hex span id.
flags: String01 (sampled) or 00.
tracestate: StringOptional tracestate header value (vendor-specific).
Implementations§
Source§impl ObsTraceCtx
impl ObsTraceCtx
Sourcepub fn fresh(sampled: bool) -> ObsTraceCtx
pub fn fresh(sampled: bool) -> ObsTraceCtx
Build a fresh context with a new trace id and span id, with the supplied sampling decision. Useful for client-side root spans.
Sourcepub fn child_of(&self) -> ObsTraceCtx
pub fn child_of(&self) -> ObsTraceCtx
Build a child context that inherits the parent trace id and flags, but mints a fresh span id.
Trait Implementations§
Source§impl Clone for ObsTraceCtx
impl Clone for ObsTraceCtx
Source§fn clone(&self) -> ObsTraceCtx
fn clone(&self) -> ObsTraceCtx
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ObsTraceCtx
impl Debug for ObsTraceCtx
Source§impl Default for ObsTraceCtx
impl Default for ObsTraceCtx
Source§fn default() -> ObsTraceCtx
fn default() -> ObsTraceCtx
Returns the “default value” for a type. Read more
Source§impl PartialEq for ObsTraceCtx
impl PartialEq for ObsTraceCtx
Source§fn eq(&self, other: &ObsTraceCtx) -> bool
fn eq(&self, other: &ObsTraceCtx) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ObsTraceCtx
impl StructuralPartialEq for ObsTraceCtx
Auto Trait Implementations§
impl Freeze for ObsTraceCtx
impl RefUnwindSafe for ObsTraceCtx
impl Send for ObsTraceCtx
impl Sync for ObsTraceCtx
impl Unpin for ObsTraceCtx
impl UnsafeUnpin for ObsTraceCtx
impl UnwindSafe for ObsTraceCtx
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.