#[non_exhaustive]pub struct TraceContext {
pub traceparent: Option<String>,
pub tracestate: Option<String>,
}Expand description
W3C Trace Context headers propagated to and from the GitHub Copilot CLI.
traceparent carries the trace and parent-span identifiers; tracestate
carries vendor-specific extensions. Either field may be None when the
caller has nothing to propagate; in that case the corresponding wire
field is omitted.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.traceparent: Option<String>traceparent HTTP header value.
tracestate: Option<String>tracestate HTTP header value.
Implementations§
Source§impl TraceContext
impl TraceContext
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct an empty TraceContext; both fields default to unset
(the SDK skips trace-context injection on the wire).
Sourcepub fn from_traceparent(traceparent: impl Into<String>) -> Self
pub fn from_traceparent(traceparent: impl Into<String>) -> Self
Construct a TraceContext from a traceparent header value, with
no tracestate.
Equivalent to TraceContext::new().with_traceparent(value); kept
for ergonomics in the common single-header case.
Sourcepub fn with_traceparent(self, traceparent: impl Into<String>) -> Self
pub fn with_traceparent(self, traceparent: impl Into<String>) -> Self
Set or replace the traceparent header value, returning self for
chaining.
Sourcepub fn with_tracestate(self, tracestate: impl Into<String>) -> Self
pub fn with_tracestate(self, tracestate: impl Into<String>) -> Self
Set or replace the tracestate header value, returning self for
chaining.
Trait Implementations§
Source§impl Clone for TraceContext
impl Clone for TraceContext
Source§fn clone(&self) -> TraceContext
fn clone(&self) -> TraceContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TraceContext
impl Debug for TraceContext
Source§impl Default for TraceContext
impl Default for TraceContext
Source§fn default() -> TraceContext
fn default() -> TraceContext
Source§impl PartialEq for TraceContext
impl PartialEq for TraceContext
Source§fn eq(&self, other: &TraceContext) -> bool
fn eq(&self, other: &TraceContext) -> bool
self and other values to be equal, and is used by ==.