Struct zipkin::OpenSpan [] [src]

pub struct OpenSpan<T> where
    T: Attachment
{ /* fields omitted */ }

An open span.

This is a guard object - the span will be finished and reported when it falls out of scope.

Spans can either be "attached" to or "detached" from their tracer. An attached span manages its tracer's current span - it acts like a CurrentGuard. A detached span does not but is Send unlike an attached span. Spans are attached by default, but can be detached or reattached via the detach and attach methods.

Detached spans are intended for use when you need to manually maintain the current trace context. For example, when working with nonblocking futures a single OS thread is managing many separate tasks. The futures-zipkin crate provides a wrapper type which ensures a context is registered as the current whenever a task is running. If some computation starts executing on one thread and finishes executing on another, you can detach the span, send it to the other thread, and then reattach it to properly model that behavior.

Methods

impl<T> OpenSpan<T> where
    T: Attachment
[src]

[src]

Returns the context associated with this span.

[src]

Sets the name of this span.

[src]

A builder-style version of name.

[src]

Sets the kind of this span.

[src]

A builder-style version of kind.

[src]

Sets the remote endpoint of this span.

[src]

A builder-style version of remote_endpoint.

[src]

Attaches an annotation to this span.

[src]

A builder-style version of annotate.

[src]

Attaches a tag to this span.

[src]

A builder-style version of tag.

impl OpenSpan<Attached>
[src]

[src]

Detaches this span's context from the tracer.

impl OpenSpan<Detached>
[src]

[src]

Re-attaches this span's context to the tracer.

Trait Implementations

impl<T> Drop for OpenSpan<T> where
    T: Attachment
[src]

[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<T> Send for OpenSpan<T> where
    T: Send

impl<T> Sync for OpenSpan<T> where
    T: Sync