[][src]Struct opentracingrust::tracers::NoopTracer

pub struct NoopTracer { /* fields omitted */ }

A tracer that discards spans.

Like for other tracers, spans are still collected in full and are cost memory until they are read from the FinishedSpan receiver and dropped.

Unlike other tracers, the NoopTracer will not propagate or extract tracing information and will discard all FinishedSpans when they are NoopTracer::reported.

This is especially useful as a way to effectively disable tracing in applications built with OpenTracing support when the end user does not wish to collect tracing information.

Examples

extern crate opentracingrust;

use opentracingrust::tracers::NoopTracer;


fn main() {
    let (tracer, receiver) = NoopTracer::new();
    // ... snip ...
}

Methods

impl NoopTracer[src]

pub fn new() -> (Tracer, SpanReceiver)[src]

Instantiate a new NoopTracer.

pub fn report(span: FinishedSpan)[src]

"Reports" the finished span into nowere.

FinishedSpans passed to this method are simply dropped. This method is to provide a common interface with other tracers.

Trait Implementations

impl TracerInterface for NoopTracer[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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<V, T> VZip<V> for T where
    V: MultiLane<T>,