Struct NoopTracer
pub struct NoopTracer { /* private fields */ }
Available on crate feature
opentelemetry
only.Expand description
A no-op instance of a Tracer
.
Implementations§
§impl NoopTracer
impl NoopTracer
pub fn new() -> NoopTracer
pub fn new() -> NoopTracer
Create a new no-op tracer
Trait Implementations§
§impl Clone for NoopTracer
impl Clone for NoopTracer
§fn clone(&self) -> NoopTracer
fn clone(&self) -> NoopTracer
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for NoopTracer
impl Debug for NoopTracer
§impl Default for NoopTracer
impl Default for NoopTracer
§fn default() -> NoopTracer
fn default() -> NoopTracer
Returns the “default value” for a type. Read more
Source§impl PreSampledTracer for NoopTracer
impl PreSampledTracer for NoopTracer
Source§fn sampled_context(&self, data: &mut OtelData) -> Context
fn sampled_context(&self, data: &mut OtelData) -> Context
Produce an otel context containing an active and pre-sampled span for
the given span builder data. Read more
Source§fn new_trace_id(&self) -> TraceId
fn new_trace_id(&self) -> TraceId
Generate a new trace id.
Source§fn new_span_id(&self) -> SpanId
fn new_span_id(&self) -> SpanId
Generate a new span id.
§impl Tracer for NoopTracer
impl Tracer for NoopTracer
§fn build_with_context(
&self,
_builder: SpanBuilder,
parent_cx: &Context,
) -> <NoopTracer as Tracer>::Span
fn build_with_context( &self, _builder: SpanBuilder, parent_cx: &Context, ) -> <NoopTracer as Tracer>::Span
Builds a NoopSpan
from a SpanBuilder
.
If the span builder or the context’s current span contains a valid span context, it is propagated.
§fn start_with_context<T>(&self, name: T, parent_cx: &Context) -> Self::Span
fn start_with_context<T>(&self, name: T, parent_cx: &Context) -> Self::Span
§fn span_builder<T>(&self, name: T) -> SpanBuilder
fn span_builder<T>(&self, name: T) -> SpanBuilder
Creates a span builder. Read more
§fn build(&self, builder: SpanBuilder) -> Self::Span
fn build(&self, builder: SpanBuilder) -> Self::Span
Start a
Span
from a SpanBuilder
.Auto Trait Implementations§
impl Freeze for NoopTracer
impl RefUnwindSafe for NoopTracer
impl Send for NoopTracer
impl Sync for NoopTracer
impl Unpin for NoopTracer
impl UnwindSafe for NoopTracer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<S, T> ObjectSafeTracer for T
impl<S, T> ObjectSafeTracer for T
§fn build_with_context_boxed(
&self,
builder: SpanBuilder,
parent_cx: &Context,
) -> Box<dyn ObjectSafeSpan + Sync + Send>
fn build_with_context_boxed( &self, builder: SpanBuilder, parent_cx: &Context, ) -> Box<dyn ObjectSafeSpan + Sync + Send>
Returns a trait object so the underlying implementation can be swapped out at runtime.