Struct rustracing::Tracer [−][src]
pub struct Tracer<S, T> { /* fields omitted */ }
Tracer.
Examples
use rustracing::Tracer; use rustracing::sampler::AllSampler; let (tracer, span_rx) = Tracer::new(AllSampler); { let _span = tracer.span("foo").start_with_state(()); } let span = span_rx.try_recv().unwrap(); assert_eq!(span.operation_name(), "foo");
Methods
impl<S: Sampler<T>, T> Tracer<S, T>
[src]
impl<S: Sampler<T>, T> Tracer<S, T>
pub fn new(sampler: S) -> (Self, SpanReceiver<T>)
[src]
pub fn new(sampler: S) -> (Self, SpanReceiver<T>)
Makes a new Tracer
instance.
pub fn span<N>(&self, operation_name: N) -> StartSpanOptions<S, T> where
N: Into<Cow<'static, str>>,
[src]
pub fn span<N>(&self, operation_name: N) -> StartSpanOptions<S, T> where
N: Into<Cow<'static, str>>,
Returns StartSpanOptions
for starting a span which has the name operation_name
.
impl<S, T> Tracer<S, T>
[src]
impl<S, T> Tracer<S, T>
pub fn clone_with_sampler<U: Sampler<T>>(&self, sampler: U) -> Tracer<U, T>
[src]
pub fn clone_with_sampler<U: Sampler<T>>(&self, sampler: U) -> Tracer<U, T>
Clone with the given sampler
.
Trait Implementations
impl<S: Debug, T: Debug> Debug for Tracer<S, T>
[src]
impl<S: Debug, T: Debug> Debug for Tracer<S, 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<S, T> Clone for Tracer<S, T>
[src]
impl<S, T> Clone for Tracer<S, T>