pub struct TracingContext {
pub trace_id: u128,
pub span_id: u64,
pub tracestate: String,
pub trace_flags: u8,
}Expand description
OpenTelemetry tracing context (W3C Trace Context) See: https://www.w3.org/TR/trace-context/
Fields§
§trace_id: u128Trace ID (128-bit identifier)
span_id: u64Span ID (64-bit identifier)
tracestate: StringTracestate header value
trace_flags: u8Trace flags (8-bit flags)
Implementations§
Source§impl TracingContext
impl TracingContext
Sourcepub fn with_ids(trace_id: u128, span_id: u64) -> Self
pub fn with_ids(trace_id: u128, span_id: u64) -> Self
Create a tracing context with trace and span IDs
Sourcepub fn tracestate(self, tracestate: impl Into<String>) -> Self
pub fn tracestate(self, tracestate: impl Into<String>) -> Self
Set tracestate
Sourcepub fn trace_flags(self, flags: u8) -> Self
pub fn trace_flags(self, flags: u8) -> Self
Set trace flags
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if tracing is enabled (non-zero trace_id)
Trait Implementations§
Source§impl Clone for TracingContext
impl Clone for TracingContext
Source§fn clone(&self) -> TracingContext
fn clone(&self) -> TracingContext
Returns a duplicate of the value. Read more
1.0.0 · 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 TracingContext
impl Debug for TracingContext
Source§impl Default for TracingContext
impl Default for TracingContext
Source§fn default() -> TracingContext
fn default() -> TracingContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TracingContext
impl RefUnwindSafe for TracingContext
impl Send for TracingContext
impl Sync for TracingContext
impl Unpin for TracingContext
impl UnwindSafe for TracingContext
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