[−][src]Struct rustracing::span::SpanContext
Span context.
Each SpanContext
encapsulates the following state:
T
: OpenTracing-implementation-dependent state (for example, trace and span ids) needed to refer to a distinctSpan
across a process boundaryBaggageItems
: 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]
C: TextMap,
T: InjectToTextMap<C>,
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]
C: SetHttpHeaderField,
T: InjectToHttpHeader<C>,
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]
C: Write,
T: InjectToBinary<C>,
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]
C: TextMap,
T: ExtractFromTextMap<C>,
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]
C: IterHttpHeaderFields<'a>,
T: ExtractFromHttpHeader<'a, C>,
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]
C: Read,
T: ExtractFromBinary<C>,
Extracts a context from the Binary carrier
.
Trait Implementations
impl<T> MaybeAsRef<SpanContext<T>> for Span<T>
[src]
fn maybe_as_ref(&self) -> Option<&SpanContext<T>>
[src]
impl<T> MaybeAsRef<SpanContext<T>> for SpanContext<T>
[src]
fn maybe_as_ref(&self) -> Option<&Self>
[src]
impl<T: Clone> Clone for SpanContext<T>
[src]
fn clone(&self) -> SpanContext<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for SpanContext<T>
[src]
Auto Trait Implementations
impl<T> Send for SpanContext<T> where
T: Send,
T: Send,
impl<T> Sync for SpanContext<T> where
T: Sync,
T: Sync,
impl<T> Unpin for SpanContext<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for SpanContext<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for SpanContext<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,