diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:13:23 +0000 |
commit | 20431706a863f92cb37dc512fef6e48d192aaf2c (patch) | |
tree | 2867f13f5fd5437ba628c67d7f87309ccadcd286 /vendor/tracing-subscriber-0.3.3/src/registry/sharded.rs | |
parent | Releasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip |
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/tracing-subscriber-0.3.3/src/registry/sharded.rs (renamed from vendor/tracing-subscriber/src/registry/sharded.rs) | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/vendor/tracing-subscriber/src/registry/sharded.rs b/vendor/tracing-subscriber-0.3.3/src/registry/sharded.rs index b81d5fef8..a6311cb71 100644 --- a/vendor/tracing-subscriber/src/registry/sharded.rs +++ b/vendor/tracing-subscriber-0.3.3/src/registry/sharded.rs @@ -75,16 +75,16 @@ use tracing_core::{ /// the distributed tracing system. These IDs can be associated with /// `tracing` spans using [fields] and/or [stored span data]. /// -/// [span IDs]: tracing_core::span::Id -/// [slab]: sharded_slab +/// [span IDs]: https://docs.rs/tracing-core/latest/tracing_core/span/struct.Id.html +/// [slab]: https://docs.rs/crate/sharded-slab/ /// [`Layer`]: crate::Layer /// [added]: crate::layer::Layer#composing-layers /// [extensions]: super::Extensions /// [closed]: https://docs.rs/tracing/latest/tracing/span/index.html#closing-spans -/// [considered closed]: tracing_core::subscriber::Subscriber::try_close() +/// [considered closed]: https://docs.rs/tracing-core/latest/tracing_core/subscriber/trait.Subscriber.html#method.try_close /// [`Span`]: https://docs.rs/tracing/latest/tracing/span/struct.Span.html /// [ot]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#spancontext -/// [fields]: tracing_core::field +/// [fields]: https://docs.rs/tracing-core/latest/tracing-core/field/index.html /// [stored span data]: crate::registry::SpanData::extensions_mut #[cfg(feature = "registry")] #[cfg_attr(docsrs, doc(cfg(all(feature = "registry", feature = "std"))))] @@ -102,8 +102,9 @@ pub struct Registry { /// [`Layer`s], such as formatted fields, metrics, or distributed traces should /// be stored in the [extensions] typemap. /// -/// [`Layer`s]: crate::layer::Layer -/// [extensions]: Extensions +/// [`Registry`]: struct.Registry.html +/// [`Layer`s]: ../layer/trait.Layer.html +/// [extensions]: struct.Extensions.html #[cfg(feature = "registry")] #[cfg_attr(docsrs, doc(cfg(all(feature = "registry", feature = "std"))))] #[derive(Debug)] @@ -114,11 +115,10 @@ pub struct Data<'a> { /// Stored data associated with a span. /// -/// This type is pooled using [`sharded_slab::Pool`]; when a span is -/// dropped, the `DataInner` entry at that span's slab index is cleared -/// in place and reused by a future span. Thus, the `Default` and -/// [`sharded_slab::Clear`] implementations for this type are -/// load-bearing. +/// This type is pooled using `sharded_slab::Pool`; when a span is dropped, the +/// `DataInner` entry at that span's slab index is cleared in place and reused +/// by a future span. Thus, the `Default` and `sharded_slab::Clear` +/// implementations for this type are load-bearing. #[derive(Debug)] struct DataInner { filter_map: FilterMap, @@ -173,6 +173,7 @@ fn id_to_idx(id: &Id) -> usize { /// greater than 0, `CloseGuard` decrements the counter by one and /// _does not_ remove the span from the [`Registry`]. /// +/// [`Registry`]: ./struct.Registry.html pub(crate) struct CloseGuard<'a> { id: Id, registry: &'a Registry, @@ -188,6 +189,7 @@ impl Registry { /// processed an `on_close` notification via the `CLOSE_COUNT` thread-local. /// For additional details, see [`CloseGuard`]. /// + /// [`CloseGuard`]: ./struct.CloseGuard.html pub(crate) fn start_close(&self, id: Id) -> CloseGuard<'_> { CLOSE_COUNT.with(|count| { let c = count.get(); @@ -214,6 +216,7 @@ thread_local! { /// track how many layers have processed the close. /// For additional details, see [`CloseGuard`]. /// + /// [`CloseGuard`]: ./struct.CloseGuard.html static CLOSE_COUNT: Cell<usize> = Cell::new(0); } @@ -377,7 +380,7 @@ impl<'a> LookupSpan<'a> for Registry { // === impl CloseGuard === impl<'a> CloseGuard<'a> { - pub(crate) fn set_closing(&mut self) { + pub(crate) fn is_closing(&mut self) { self.is_closing = true; } } |