Struct TracePropagationContext
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§
§impl TracePropagationContext
impl TracePropagationContext
pub fn new(trace_id: TraceId, span_id: SpanId) -> TracePropagationContext
pub fn new(trace_id: TraceId, span_id: SpanId) -> TracePropagationContext
Creates a new TracePropagationContext from the provided parameters
pub fn with_sampled(self, sampled: bool) -> TracePropagationContext
pub fn with_sampled(self, sampled: bool) -> TracePropagationContext
Set the sampling decision on self.
pub fn sentry_trace_header(&self) -> String
pub fn sentry_trace_header(&self) -> String
Computes the sentry-trace header for this TracePropagationContext.
pub fn try_from_headers<'a, I>(
headers: I,
) -> Result<TracePropagationContext, HeaderParseError>
pub fn try_from_headers<'a, I>( headers: I, ) -> Result<TracePropagationContext, 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§
§impl Clone for TracePropagationContext
impl Clone for TracePropagationContext
§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 more§impl Debug for TracePropagationContext
impl Debug for TracePropagationContext
§impl Default for TracePropagationContext
impl Default for TracePropagationContext
§fn default() -> TracePropagationContext
fn default() -> TracePropagationContext
Returns the “default value” for a type. Read more
§impl From<SentryTrace> for TracePropagationContext
impl From<SentryTrace> for TracePropagationContext
§fn from(trace: SentryTrace) -> TracePropagationContext
fn from(trace: SentryTrace) -> TracePropagationContext
Converts to this type from the input type.
§impl PartialEq for TracePropagationContext
impl PartialEq for TracePropagationContext
§fn eq(&self, other: &TracePropagationContext) -> bool
fn eq(&self, other: &TracePropagationContext) -> bool
Tests for
self and other values to be equal, and is used by ==.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more