pub struct TraceContext { /* private fields */ }
Expand description
A TraceContext
represents a distributed trace request.
It consists of a trace ID, the ID of the parent span, the ID of the context’s span, and flags dealing with the sampling of the span.
The trace context is sent to remote services on requests. For example, it is included in a standard set of headers in HTTP requests.
Implementations§
Source§impl TraceContext
impl TraceContext
Sourcepub fn parent_id(&self) -> Option<SpanId>
pub fn parent_id(&self) -> Option<SpanId>
Returns the ID of the parent of the span associated with this context.
Sourcepub fn sampling_flags(&self) -> SamplingFlags
pub fn sampling_flags(&self) -> SamplingFlags
Returns the sampling flags associated with this context.
Trait Implementations§
Source§impl Clone for TraceContext
impl Clone for TraceContext
Source§fn clone(&self) -> TraceContext
fn clone(&self) -> TraceContext
Returns a copy 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 From<TraceContext> for Builder
impl From<TraceContext> for Builder
Source§fn from(c: TraceContext) -> Builder
fn from(c: TraceContext) -> Builder
Converts to this type from the input type.
Source§impl PartialEq for TraceContext
impl PartialEq for TraceContext
impl Copy for TraceContext
impl Eq 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 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