pub struct TracePropagationContext { /* private fields */ }Expand description
The trace propagation context.
Contains the information necessary for propagating Sentry traces and continuing traces from incoming requests.
The data stored in this struct can be parsed from and transmitted as sentry-trace and Sentry
baggage headers.
Note that the Rust SDK only partially supports trace propagation, certain features such as dynamic sampling may be missing or incomplete.
Implementations§
Source§impl TracePropagationContext
impl TracePropagationContext
Sourcepub fn new(trace_id: TraceId, span_id: SpanId) -> Self
pub fn new(trace_id: TraceId, span_id: SpanId) -> Self
Creates a new TracePropagationContext from the provided parameters
Sourcepub fn with_sampled(self, sampled: bool) -> Self
pub fn with_sampled(self, sampled: bool) -> Self
Set the sampling decision on self.
Sourcepub fn sentry_trace_header(&self) -> String
pub fn sentry_trace_header(&self) -> String
Computes the sentry-trace header for this TracePropagationContext.
Sourcepub fn try_from_headers<'a, I>(headers: I) -> Result<Self, HeaderParseError>
pub fn try_from_headers<'a, I>(headers: I) -> Result<Self, HeaderParseError>
Attempt to parse a list of Sentry headers into TracePropagationContext.
The parsing will fail if there is no valid sentry-trace header.
Trait Implementations§
Source§impl Clone for TracePropagationContext
impl Clone for TracePropagationContext
Source§fn clone(&self) -> TracePropagationContext
fn clone(&self) -> TracePropagationContext
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 moreSource§impl Debug for TracePropagationContext
impl Debug for TracePropagationContext
Source§impl Default for TracePropagationContext
impl Default for TracePropagationContext
Source§fn default() -> TracePropagationContext
fn default() -> TracePropagationContext
Returns the “default value” for a type. Read more
Source§impl From<SentryTrace> for TracePropagationContext
impl From<SentryTrace> for TracePropagationContext
Source§fn from(trace: SentryTrace) -> Self
fn from(trace: SentryTrace) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TracePropagationContext
impl PartialEq for TracePropagationContext
impl StructuralPartialEq for TracePropagationContext
Auto Trait Implementations§
impl Freeze for TracePropagationContext
impl RefUnwindSafe for TracePropagationContext
impl Send for TracePropagationContext
impl Sync for TracePropagationContext
impl Unpin for TracePropagationContext
impl UnsafeUnpin for TracePropagationContext
impl UnwindSafe for TracePropagationContext
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