Make docs.rs document feature-gated public items.

This commit is contained in:
Tim Kuehn
2020-07-28 19:43:43 -07:00
parent 5f02d7383a
commit 0e5973109d
5 changed files with 10 additions and 0 deletions

View File

@@ -50,6 +50,10 @@ tokio = { version = "0.2", features = ["full"] }
tokio-serde = { version = "0.6", features = ["json"] }
trybuild = "1.0"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[[example]]
name = "server_calling_server"
required-features = ["full"]

View File

@@ -206,6 +206,7 @@ pub mod rpc;
pub use rpc::*;
#[cfg(feature = "serde-transport")]
#[cfg_attr(docsrs, doc(cfg(feature = "serde-transport")))]
pub mod serde_transport;
pub mod trace;

View File

@@ -141,6 +141,7 @@ where
{
/// Helper method to spawn the dispatch on the default executor.
#[cfg(feature = "tokio1")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio1")))]
pub fn spawn(self) -> io::Result<C> {
use log::error;

View File

@@ -647,6 +647,7 @@ where
/// Runs the client handler until completion by spawning each
/// request handler onto the default executor.
#[cfg(feature = "tokio1")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio1")))]
pub fn execute(self) -> impl Future<Output = ()> {
use log::info;
@@ -663,6 +664,7 @@ where
#[pin_project]
#[derive(Debug)]
#[cfg(feature = "tokio1")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio1")))]
pub struct Running<St, Se> {
#[pin]
incoming: St,
@@ -670,6 +672,7 @@ pub struct Running<St, Se> {
}
#[cfg(feature = "tokio1")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio1")))]
impl<St, C, Se> Future for Running<St, Se>
where
St: Sized + Stream<Item = C>,

View File

@@ -11,6 +11,7 @@ use std::{
};
#[cfg(feature = "serde")]
#[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
pub mod serde;
/// Extension trait for [SystemTimes](SystemTime) in the future, i.e. deadlines.