pub struct TraceContext {
pub trace_id: String,
pub span_id: String,
pub trace_flags: Option<u8>,
pub trace_state: Option<String>,
}Expand description
TraceContext - W3C Trace Context for distributed tracing
Fields§
§trace_id: StringTrace ID (32 hex chars)
span_id: StringSpan ID (16 hex chars)
trace_flags: Option<u8>Sampling flags
trace_state: Option<String>Vendor-specific state
Implementations§
Source§impl TraceContext
impl TraceContext
Sourcepub fn child_span(&self) -> Self
pub fn child_span(&self) -> Self
Create a child span context (same trace, new span)
Sourcepub fn from_traceparent(header: &str) -> Option<Self>
pub fn from_traceparent(header: &str) -> Option<Self>
Parse from W3C traceparent header
Sourcepub fn to_traceparent(&self) -> String
pub fn to_traceparent(&self) -> String
Format as W3C traceparent header
Trait Implementations§
Source§impl Clone for TraceContext
impl Clone for TraceContext
Source§fn clone(&self) -> TraceContext
fn clone(&self) -> TraceContext
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 TraceContext
impl Debug for TraceContext
Source§impl Default for TraceContext
impl Default for TraceContext
Source§impl<'de> Deserialize<'de> for TraceContext
impl<'de> Deserialize<'de> for TraceContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TraceContext
impl RefUnwindSafe for TraceContext
impl Send for TraceContext
impl Sync for TraceContext
impl Unpin for TraceContext
impl UnsafeUnpin for TraceContext
impl UnwindSafe for TraceContext
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