core: minor doc fixes (#259)

This branch makes some minor tweaks to the `tracing-core` RustDoc,
including fixing some broken links, and using `#[doc(inline)]` on some
of the more important re-exports so they're highlighted front and centre
in the docs.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
Eliza Weisman 2019-08-09 15:50:50 -07:00 committed by GitHub
parent 44e5e5fca4
commit cf0ea3c07b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View File

@ -132,7 +132,7 @@
//! currently default `Dispatch`. This is used primarily by `tracing` //! currently default `Dispatch`. This is used primarily by `tracing`
//! instrumentation. //! instrumentation.
//! //!
//! [`Subscriber`]: ../subscriber/struct.Subscriber.html //! [`Subscriber`]: struct.Subscriber.html
//! [`with_default`]: fn.with_default.html //! [`with_default`]: fn.with_default.html
//! [`set_global_default`]: fn.set_global_default.html //! [`set_global_default`]: fn.set_global_default.html
//! [`get_default`]: fn.get_default.html //! [`get_default`]: fn.get_default.html
@ -160,7 +160,7 @@ use crate::stdlib::{
/// `Dispatch` trace data to a [`Subscriber`]. /// `Dispatch` trace data to a [`Subscriber`].
/// ///
/// [`Subscriber`]: ../subscriber/trait.Subscriber.html /// [`Subscriber`]: trait.Subscriber.html
#[derive(Clone)] #[derive(Clone)]
pub struct Dispatch { pub struct Dispatch {
subscriber: Arc<dyn Subscriber + Send + Sync>, subscriber: Arc<dyn Subscriber + Send + Sync>,

View File

@ -221,15 +221,18 @@ pub mod span;
pub(crate) mod stdlib; pub(crate) mod stdlib;
pub mod subscriber; pub mod subscriber;
#[doc(inline)]
pub use self::{ pub use self::{
callsite::Callsite, callsite::Callsite,
dispatcher::Dispatch, dispatcher::Dispatch,
event::Event, event::Event,
field::Field, field::Field,
metadata::{Kind, Level, Metadata}, metadata::{Level, Metadata},
subscriber::{Interest, Subscriber}, subscriber::Subscriber,
}; };
pub use self::{metadata::Kind, subscriber::Interest};
mod sealed { mod sealed {
pub trait Sealed {} pub trait Sealed {}
} }

View File

@ -62,7 +62,7 @@ use crate::stdlib::any::{Any, TypeId};
/// ///
/// [ID]: ../span/struct.Id.html /// [ID]: ../span/struct.Id.html
/// [`new_span`]: trait.Subscriber.html#method.new_span /// [`new_span`]: trait.Subscriber.html#method.new_span
/// [`register_callsite]: trait.Subscriber.html#method.register_callsite /// [`register_callsite`]: trait.Subscriber.html#method.register_callsite
/// [`Interest`]: struct.Interest.html /// [`Interest`]: struct.Interest.html
/// [`enabled`]: trait.Subscriber.html#method.enabled /// [`enabled`]: trait.Subscriber.html#method.enabled
/// [`clone_span`]: trait.Subscriber.html#method.clone_span /// [`clone_span`]: trait.Subscriber.html#method.clone_span
@ -451,8 +451,8 @@ impl dyn Subscriber {
/// `Subscriber`s return an `Interest` from their [`register_callsite`] methods /// `Subscriber`s return an `Interest` from their [`register_callsite`] methods
/// in order to determine whether that span should be enabled or disabled. /// in order to determine whether that span should be enabled or disabled.
/// ///
/// [`Subscriber`] trait.Subscriber.html /// [`Subscriber`] ../trait.Subscriber.html
/// [clone_span]: trait.Subscriber.html#method.register_callsite /// [clone_span]: ../trait.Subscriber.html#method.register_callsite
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct Interest(InterestKind); pub struct Interest(InterestKind);