pub struct TraceContext {
pub trace_id: String,
pub span_id: String,
pub parent_span_id: Option<String>,
pub attributes: HashMap<String, String>,
}Expand description
Trace context
Fields§
§trace_id: StringTrace ID
span_id: StringSpan ID
parent_span_id: Option<String>Parent Span ID
attributes: HashMap<String, String>Attributes
Implementations§
Source§impl TraceContext
impl TraceContext
Sourcepub fn child_span(&self) -> Self
pub fn child_span(&self) -> Self
Create a child span
Sourcepub fn with_attribute(self, key: &str, value: &str) -> Self
pub fn with_attribute(self, key: &str, value: &str) -> Self
Add an attribute
Sourcepub fn set_attribute(&mut self, key: &str, value: &str)
pub fn set_attribute(&mut self, key: &str, value: &str)
Add an attribute
Sourcepub fn to_headers(&self) -> HashMap<String, String>
pub fn to_headers(&self) -> HashMap<String, String>
Headers for propagation
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 · 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
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