pub struct TraceContext {
pub trace_id: [u8; 16],
pub span_id: [u8; 8],
pub parent_span_id: Option<[u8; 8]>,
}Expand description
W3C trace context for one emitted span. parent_span_id is set when an inbound traceparent
stitched this gateway span under an app-side span (so both land in one trace).
Fields§
§trace_id: [u8; 16]§span_id: [u8; 8]§parent_span_id: Option<[u8; 8]>Implementations§
Source§impl TraceContext
impl TraceContext
Sourcepub fn from_traceparent(traceparent: Option<&str>) -> TraceContext
pub fn from_traceparent(traceparent: Option<&str>) -> TraceContext
Derive a context from an optional inbound W3C traceparent. If it is present and well-formed,
reuse its trace id and make the inbound span our parent (app-side spans + this gateway span
stitch into one trace); otherwise mint a fresh root trace. The span id is always freshly random.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TraceContext
Source§impl Debug for TraceContext
impl Debug for TraceContext
impl Eq for TraceContext
Source§impl PartialEq for TraceContext
impl PartialEq for TraceContext
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.