[][src]Struct rustracing::span::SpanContext

pub struct SpanContext<T> { /* fields omitted */ }

Span context.

Each SpanContext encapsulates the following state:

  • T: OpenTracing-implementation-dependent state (for example, trace and span ids) needed to refer to a distinct Span across a process boundary
  • BaggageItems: These are just key:value pairs that cross process boundaries

Methods

impl<T> SpanContext<T>[src]

pub fn new(state: T, baggage_items: Vec<BaggageItem>) -> Self[src]

Makes a new SpanContext instance.

pub fn state(&self) -> &T[src]

Returns the implementation-dependent state of this context.

pub fn baggage_items(&self) -> &[BaggageItem][src]

Returns the baggage items associated with this context.

pub fn inject_to_text_map<C>(&self, carrier: &mut C) -> Result<()> where
    C: TextMap,
    T: InjectToTextMap<C>, 
[src]

Injects this context to the Text Map carrier.

pub fn inject_to_http_header<C>(&self, carrier: &mut C) -> Result<()> where
    C: SetHttpHeaderField,
    T: InjectToHttpHeader<C>, 
[src]

Injects this context to the HTTP Header carrier.

pub fn inject_to_binary<C>(&self, carrier: &mut C) -> Result<()> where
    C: Write,
    T: InjectToBinary<C>, 
[src]

Injects this context to the Binary carrier.

pub fn extract_from_text_map<C>(carrier: &C) -> Result<Option<Self>> where
    C: TextMap,
    T: ExtractFromTextMap<C>, 
[src]

Extracts a context from the Text Map carrier.

pub fn extract_from_http_header<'a, C>(carrier: &'a C) -> Result<Option<Self>> where
    C: IterHttpHeaderFields<'a>,
    T: ExtractFromHttpHeader<'a, C>, 
[src]

Extracts a context from the HTTP Header carrier.

pub fn extract_from_binary<C>(carrier: &mut C) -> Result<Option<Self>> where
    C: Read,
    T: ExtractFromBinary<C>, 
[src]

Extracts a context from the Binary carrier.

Trait Implementations

impl<T> MaybeAsRef<SpanContext<T>> for Span<T>[src]

impl<T> MaybeAsRef<SpanContext<T>> for SpanContext<T>[src]

impl<T: Clone> Clone for SpanContext<T>[src]

impl<T: Debug> Debug for SpanContext<T>[src]

Auto Trait Implementations

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

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

impl<T> Unpin for SpanContext<T> where
    T: Unpin

impl<T> UnwindSafe for SpanContext<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for SpanContext<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]