Struct tracing_subscriber::Registry [−][src]
A shared, reusable store for spans.
A Registry
is a Subscriber
around which multiple Layer
s
implementing various behaviors may be added. Unlike other types
implementing Subscriber
Registry
does not actually record traces itself:
instead, it collects and stores span data that is exposed to any Layer
s
wrapping it through implementations of the LookupSpan
trait.
The Registry
is responsible for storing span metadata, recording
relationships between spans, and tracking which spans are active and whicb
are closed. In addition, it provides a mechanism for Layer
s to store
user-defined per-span data, called extensions, in the registry. This
allows Layer
-specific data to benefit from the Registry
’s
high-performance concurrent storage.
This registry is implemented using a lock-free sharded slab, and is highly optimized for concurrent access.
Trait Implementations
impl Debug for Registry
[src]
impl Default for Registry
[src]
impl<'a> LookupSpan<'a> for Registry
[src]
type Data = Data<'a>
The type of span data stored in this registry.
fn span_data(&'a self, id: &Id) -> Option<Self::Data>
[src]
fn span(&'a self, id: &Id) -> Option<SpanRef<'_, Self>> where
Self: Sized,
[src]
Self: Sized,
impl Subscriber for Registry
[src]
fn register_callsite(&self, _: &'static Metadata<'static>) -> Interest
[src]
fn enabled(&self, _: &Metadata<'_>) -> bool
[src]
fn new_span(&self, attrs: &Attributes<'_>) -> Id
[src]
fn record(&self, _: &Id, _: &Record<'_>)
[src]
This is intentionally not implemented, as recording fields on a span is the responsibility of layers atop of this registry.
fn record_follows_from(&self, _span: &Id, _follows: &Id)
[src]
fn event(&self, _: &Event<'_>)
[src]
This is intentionally not implemented, as recording events is the responsibility of layers atop of this registry.
fn enter(&self, id: &Id)
[src]
fn exit(&self, id: &Id)
[src]
fn clone_span(&self, id: &Id) -> Id
[src]
fn current_span(&self) -> Current
[src]
fn try_close(&self, id: Id) -> bool
[src]
Decrements the reference count of the span with the given id
, and
removes the span if it is zero.
The allocated span slot will be reused when a new span is created.
pub fn max_level_hint(&self) -> Option<LevelFilter>
[src]
pub fn drop_span(&self, _id: Id)
[src]
pub unsafe fn downcast_raw(&self, id: TypeId) -> Option<*const ()>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl !UnwindSafe for Registry
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<S> SubscriberExt for S where
S: Subscriber,
[src]
S: Subscriber,
impl<T> SubscriberInitExt for T where
T: Into<Dispatch>,
[src]
T: Into<Dispatch>,
fn set_default(self) -> DefaultGuard
[src]
fn try_init(self) -> Result<(), TryInitError>
[src]
fn init(self)
[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.
pub 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>,