[−][src]Struct opentracingrust::Tracer
The library users interface to tracing.
This structure is the focus point for clients to use in combination with SpanContext
.
The configured tracer is stored in this structure and backs the available methods.
The Tracer
structure also provides some utility methods to make common operations easier.
Methods
impl Tracer
[src]
pub fn new<T: TracerInterface + 'static>(tracer: T) -> Tracer
[src]
Creates a new Tracer
for a concrete tracer.
impl Tracer
[src]
pub fn extract(&self, fmt: ExtractFormat) -> Result<Option<SpanContext>>
[src]
Attempt to extract a SpanContext from a carrier.
If the carrier (i.e, HTTP Request, RPC Message, ...) includes tracing information
this method returns Ok(Some(context))
, otherwise Ok(None)
is returned.
If the method fails to extract a context because the carrier fails or because
the tracing information is incorrectly formatted an Error
is returned.
pub fn inject(&self, context: &SpanContext, fmt: InjectFormat) -> Result<()>
[src]
Inject tracing information into a carrier.
If the method fails to inject the context because the carrier fails.
pub fn span(&self, name: &str) -> Span
[src]
Create a new Span
with the given operation name and default starting options.
pub fn span_with_options(&self, name: &str, options: StartOptions) -> Span
[src]
Create a new Span
with the given operation name and starting options.
Auto Trait Implementations
impl !RefUnwindSafe for Tracer
impl Send for Tracer
impl Sync for Tracer
impl Unpin for Tracer
impl !UnwindSafe for Tracer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,