pub struct BoxedTracer(/* private fields */);Expand description
Wraps the GlobalTracerProvider’s Tracer so it can be used generically by
applications without knowing the underlying type.
Implementations§
Source§impl BoxedTracer
impl BoxedTracer
Sourcepub fn new(tracer: Box<dyn ObjectSafeTracer + Sync + Send>) -> BoxedTracer
pub fn new(tracer: Box<dyn ObjectSafeTracer + Sync + Send>) -> BoxedTracer
Create a BoxedTracer from an object-safe tracer.
Trait Implementations§
Source§impl Debug for BoxedTracer
impl Debug for BoxedTracer
Source§impl Tracer for BoxedTracer
impl Tracer for BoxedTracer
Source§type Span = BoxedSpan
type Span = BoxedSpan
Global tracer uses BoxedSpans so that it can be a global singleton,
which is not possible if it takes generic type parameters.
Source§fn build_with_context(
&self,
builder: SpanBuilder,
parent_cx: &Context,
) -> <BoxedTracer as Tracer>::Span
fn build_with_context( &self, builder: SpanBuilder, parent_cx: &Context, ) -> <BoxedTracer as Tracer>::Span
Create a span from a SpanBuilder
Source§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
Source§fn span_builder<T>(&self, name: T) -> SpanBuilder
fn span_builder<T>(&self, name: T) -> SpanBuilder
Creates a span builder. Read more
Source§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 BoxedTracer
impl !RefUnwindSafe for BoxedTracer
impl Send for BoxedTracer
impl Sync for BoxedTracer
impl Unpin for BoxedTracer
impl !UnwindSafe for BoxedTracer
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.
Source§impl<S, T> ObjectSafeTracer for T
impl<S, T> ObjectSafeTracer for T
Source§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.