Struct rustracing::span::Span [−][src]
pub struct Span<T>(_);
Span.
When this span is dropped, it will be converted to FinishedSpan
and
it will be sent to the associated SpanReceiver
.
Methods
impl<T> Span<T>
[src]
impl<T> Span<T>
pub fn inactive() -> Self
[src]
pub fn inactive() -> Self
Makes an inactive span.
This span is never traced.
Examples
use rustracing::span::Span; let span = Span::<()>::inactive(); assert!(! span.is_sampled());
pub fn handle(&self) -> SpanHandle<T> where
T: Clone,
[src]
pub fn handle(&self) -> SpanHandle<T> where
T: Clone,
Returns a handle of this span.
pub fn is_sampled(&self) -> bool
[src]
pub fn is_sampled(&self) -> bool
Returns true
if this span is sampled (i.e., being traced).
pub fn context(&self) -> Option<&SpanContext<T>>
[src]
pub fn context(&self) -> Option<&SpanContext<T>>
Returns the context of this span.
pub fn set_operation_name<F, N>(&mut self, f: F) where
F: FnOnce() -> N,
N: Into<Cow<'static, str>>,
[src]
pub fn set_operation_name<F, N>(&mut self, f: F) where
F: FnOnce() -> N,
N: Into<Cow<'static, str>>,
Sets the operation name of this span.
pub fn set_finish_time<F>(&mut self, f: F) where
F: FnOnce() -> SystemTime,
[src]
pub fn set_finish_time<F>(&mut self, f: F) where
F: FnOnce() -> SystemTime,
Sets the finish time of this span.
pub fn set_tag<F>(&mut self, f: F) where
F: FnOnce() -> Tag,
[src]
pub fn set_tag<F>(&mut self, f: F) where
F: FnOnce() -> Tag,
Sets the tag to this span.
Sets the tags to this span.
pub fn set_baggage_item<F>(&mut self, f: F) where
F: FnOnce() -> BaggageItem,
[src]
pub fn set_baggage_item<F>(&mut self, f: F) where
F: FnOnce() -> BaggageItem,
Sets the baggage item to this span.
pub fn get_baggage_item(&self, name: &str) -> Option<&BaggageItem>
[src]
pub fn get_baggage_item(&self, name: &str) -> Option<&BaggageItem>
Gets the baggage item that has the name name
.
pub fn log<F>(&mut self, f: F) where
F: FnOnce(&mut LogBuilder),
[src]
pub fn log<F>(&mut self, f: F) where
F: FnOnce(&mut LogBuilder),
Logs structured data.
pub fn error_log<F>(&mut self, f: F) where
F: FnOnce(&mut StdErrorLogFieldsBuilder),
[src]
pub fn error_log<F>(&mut self, f: F) where
F: FnOnce(&mut StdErrorLogFieldsBuilder),
Logs an error.
This is a simple wrapper of log
method
except that the StdTag::error()
tag will be set in this method.
pub fn child<N, F>(&self, operation_name: N, f: F) -> Span<T> where
N: Into<Cow<'static, str>>,
T: Clone,
F: FnOnce(StartSpanOptions<AllSampler, T>) -> Span<T>,
[src]
pub fn child<N, F>(&self, operation_name: N, f: F) -> Span<T> where
N: Into<Cow<'static, str>>,
T: Clone,
F: FnOnce(StartSpanOptions<AllSampler, T>) -> Span<T>,
Starts a ChildOf
span if this span is sampled.
pub fn follower<N, F>(&self, operation_name: N, f: F) -> Span<T> where
N: Into<Cow<'static, str>>,
T: Clone,
F: FnOnce(StartSpanOptions<AllSampler, T>) -> Span<T>,
[src]
pub fn follower<N, F>(&self, operation_name: N, f: F) -> Span<T> where
N: Into<Cow<'static, str>>,
T: Clone,
F: FnOnce(StartSpanOptions<AllSampler, T>) -> Span<T>,
Starts a FollowsFrom
span if this span is sampled.
Trait Implementations
impl<T: Debug> Debug for Span<T>
[src]
impl<T: Debug> Debug for Span<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Drop for Span<T>
[src]
impl<T> Drop for Span<T>
impl<T> MaybeAsRef<SpanContext<T>> for Span<T>
[src]
impl<T> MaybeAsRef<SpanContext<T>> for Span<T>
fn maybe_as_ref(&self) -> Option<&SpanContext<T>>
[src]
fn maybe_as_ref(&self) -> Option<&SpanContext<T>>
Performs the conversion.