pub struct LocalTrace {
pub trace_id: String,
pub span_id: String,
pub parent_span_id: Option<String>,
pub sampled: bool,
}Expand description
Local trace link - replay eligible.
Contains trace IDs for distributed tracing systems.
Per CONTEXT.md specifics, includes sampled flag.
Fields§
§trace_id: StringUnique trace identifier
span_id: StringSpan identifier within the trace
parent_span_id: Option<String>Parent span ID (if this is a child span)
sampled: boolWhether this trace was sampled for export
Implementations§
Source§impl LocalTrace
impl LocalTrace
Sourcepub fn new(
trace_id: impl Into<String>,
span_id: impl Into<String>,
) -> LocalTrace
pub fn new( trace_id: impl Into<String>, span_id: impl Into<String>, ) -> LocalTrace
Create a new local trace.
Sourcepub fn with_parent(self, parent_span_id: impl Into<String>) -> LocalTrace
pub fn with_parent(self, parent_span_id: impl Into<String>) -> LocalTrace
Set parent span ID.
Sourcepub fn with_sampled(self, sampled: bool) -> LocalTrace
pub fn with_sampled(self, sampled: bool) -> LocalTrace
Set sampled flag.
Trait Implementations§
Source§impl Clone for LocalTrace
impl Clone for LocalTrace
Source§fn clone(&self) -> LocalTrace
fn clone(&self) -> LocalTrace
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 LocalTrace
impl Debug for LocalTrace
Source§impl<'de> Deserialize<'de> for LocalTrace
impl<'de> Deserialize<'de> for LocalTrace
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LocalTrace, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LocalTrace, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for LocalTrace
impl Serialize for LocalTrace
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for LocalTrace
impl RefUnwindSafe for LocalTrace
impl Send for LocalTrace
impl Sync for LocalTrace
impl Unpin for LocalTrace
impl UnsafeUnpin for LocalTrace
impl UnwindSafe for LocalTrace
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