#[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
impl Eq for 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 ==.impl StructuralPartialEq for TraceContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.