[−][src]Struct opentracingrust::tracers::NoopTracer
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 FinishedSpan
s when they are NoopTracer::report
ed.
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.
FinishedSpan
s 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]
fn extract(&self, _fmt: ExtractFormat) -> Result<Option<SpanContext>>
[src]
fn inject(&self, _context: &SpanContext, _fmt: InjectFormat) -> Result<()>
[src]
fn span(&self, name: &str, options: StartOptions) -> Span
[src]
Auto Trait Implementations
impl Sync for NoopTracer
impl Unpin for NoopTracer
impl Send for NoopTracer
impl RefUnwindSafe for NoopTracer
impl UnwindSafe for NoopTracer
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, 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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,