Struct mick_jaeger::Span
source · [−]pub struct Span { /* private fields */ }
Implementations
sourceimpl Span
impl Span
sourcepub fn child_with_id(
&self,
span_id: NonZeroU64,
operation_name: impl Into<String>
) -> Span
pub fn child_with_id(
&self,
span_id: NonZeroU64,
operation_name: impl Into<String>
) -> Span
Creates a new Span
, child of this one, with a specific ID.
sourcepub fn trace_id(&self) -> NonZeroU128
pub fn trace_id(&self) -> NonZeroU128
Returns the trace ID originally passed when building this span.
sourcepub fn span_id(&self) -> NonZeroU64
pub fn span_id(&self) -> NonZeroU64
Returns the span ID originally passed when building this span.
sourcepub fn add_follows_from(&mut self, other: &Span)
pub fn add_follows_from(&mut self, other: &Span)
Adds a “followfrom” relation ship towards another span of (potentially) another trace.
sourcepub fn add_follows_from_raw(
&mut self,
trace_id: NonZeroU128,
span_id: NonZeroU64
)
pub fn add_follows_from_raw(
&mut self,
trace_id: NonZeroU128,
span_id: NonZeroU64
)
Adds a “followfrom” relation ship towards another span of (potentially) another trace.
sourcepub fn add_string_tag(&mut self, key: &str, value: &str)
pub fn add_string_tag(&mut self, key: &str, value: &str)
Add a new key-value tag to this span.
sourcepub fn add_int_tag(&mut self, key: &str, value: i64)
pub fn add_int_tag(&mut self, key: &str, value: i64)
Add a new key-value tag to this span.
sourcepub fn override_start_time(&mut self, start_time: StartTime)
pub fn override_start_time(&mut self, start_time: StartTime)
Modifies the start time of this span.
Note: This method can be useful in order to generate a span with a
trace_id
that is only know after the span should have started. To do so, callStartTime::now
when the span should start, create the span once you know the ̀trace_id
, then call this method.
sourcepub fn with_start_time_override(self, start_time: StartTime) -> Self
pub fn with_start_time_override(self, start_time: StartTime) -> Self
Modifies the start time of this span.
Note: This method can be useful in order to generate a span with a
trace_id
that is only know after the span should have started. To do so, callStartTime::now
when the span should start, create the span once you know the ̀trace_id
, then call this method.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnwindSafe for Span
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more