[−][src]Struct opentracingrust::AutoFinishingSpan
A Span
wrapper that finishes a span when dropped.
Panics
If the inner span fails to Span::finish
correctly the AutoFinishingSpan
will cause the current thread to panic when it is dropped.
Methods
impl AutoFinishingSpan
[src]
pub fn context(&self) -> &SpanContext
[src]
Access the SpanContext
for the inner Span
.
pub fn log(&mut self, log: Log)
[src]
Attach a log event to the span.
Methods from Deref<Target = Span>
pub fn child_of(&mut self, parent: SpanContext)
[src]
Marks this span as a child of the given context.
pub fn context(&self) -> &SpanContext
[src]
Access the SpanContext
of this span.
pub fn finish_time(&mut self, finish_time: SystemTime)
[src]
Set the span finish time.
This method allows to set the finish time of an operation explicitly and still manipulate the span further. This allows to time the operation first and the populate the span with any available detail without obfuscating the duration of the real operation.
pub fn follows(&mut self, parent: SpanContext)
[src]
Marks this span as a follower of the given context.
pub fn get_baggage_item(&self, key: &str) -> Option<&String>
[src]
Attempt to fetch a baggage item by key.
If there is no item with the given key this method returns None
.
pub fn log(&mut self, log: Log)
[src]
Attach a log event to the span.
pub fn operation_name(&self) -> &str
[src]
Returns the operation name.
pub fn reference_span(&mut self, reference: SpanReference)
[src]
Adds a reference to a SpanContext
.
pub fn references(&self) -> &[SpanReference]
[src]
Access all referenced span contexts and their relationship.
pub fn set_baggage_item(&mut self, key: &str, value: &str)
[src]
Adds or updates the baggage items with the given key/value pair.
Baggage items are forwarded to Span
s that reference this Span
and all the Span
s that reference them.
Baggage items are NOT propagated backwards to Span
s that reference this Span
.
pub fn set_operation_name(&mut self, name: &str)
[src]
Updates the operation name.
pub fn tag<TV: Into<TagValue>>(&mut self, tag: &str, value: TV)
[src]
Append a tag to the span.
Examples
extern crate opentracingrust; use opentracingrust::tracers::NoopTracer; fn main() { let (tracer, _) = NoopTracer::new(); let mut span = tracer.span("some_work"); span.tag("client.name", "some-tracing-client"); span.tag("client.version", 3.4); // ... snip ... }
Trait Implementations
impl AsMut<Span> for AutoFinishingSpan
[src]
impl Drop for AutoFinishingSpan
[src]
impl Deref for AutoFinishingSpan
[src]
impl DerefMut for AutoFinishingSpan
[src]
impl Debug for AutoFinishingSpan
[src]
Auto Trait Implementations
impl Send for AutoFinishingSpan
impl Unpin for AutoFinishingSpan
impl !Sync for AutoFinishingSpan
impl !UnwindSafe for AutoFinishingSpan
impl !RefUnwindSafe for AutoFinishingSpan
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,