Skip to content

Commit 4b8f5ed

Browse files
doc: Show required features on docs.rs
1 parent 7d2aaef commit 4b8f5ed

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

libs/pavex/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg_attr(docsrs, feature(doc_cfg))]
12
//! # Pavex - API reference
23
//!
34
//! Welcome to the API reference for Pavex!
@@ -16,9 +17,11 @@ pub use response::{into_response::IntoResponse, response_::Response};
1617

1718
pub mod blueprint;
1819
#[cfg(feature = "config")]
20+
#[cfg_attr(docsrs, doc(cfg(feature = "config")))]
1921
pub mod config;
2022
pub mod connection;
2123
#[cfg(feature = "cookie")]
24+
#[cfg_attr(docsrs, doc(cfg(feature = "cookie")))]
2225
pub mod cookie;
2326
pub mod error;
2427
pub mod http;
@@ -28,10 +31,12 @@ pub mod response;
2831
pub mod router;
2932
pub mod serialization;
3033
#[cfg(feature = "server")]
34+
#[cfg_attr(docsrs, doc(cfg(feature = "server")))]
3135
pub mod server;
3236
pub mod telemetry;
3337
pub mod unit;
3438
#[cfg(feature = "time")]
39+
#[cfg_attr(docsrs, doc(cfg(feature = "time")))]
3540
pub mod time {
3641
//! Utilities to work with dates, timestamps and datetimes.
3742
//!

libs/pavex/src/telemetry/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//! Tools to instrument and troubleshoot your Pavex applications.
22
#[cfg(feature = "server_request_id")]
3+
#[cfg_attr(docsrs, doc(cfg(feature = "server_request_id")))]
34
mod server_request_id;
45

56
#[cfg(feature = "server_request_id")]
7+
#[cfg_attr(docsrs, doc(cfg(feature = "server_request_id")))]
68
pub use server_request_id::ServerRequestId;

libs/pavex/src/tls/client/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ pub mod config;
66
pub use config::_config::TlsClientPolicyConfig;
77

88
#[cfg(feature = "rustls_0_23")]
9+
#[cfg_attr(docsrs, doc(cfg(feature = "rustls_0_23")))]
910
mod rustls_0_23;

libs/pavex/src/tls/client/rustls_0_23.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ impl TryFrom<&TlsClientPolicyConfig> for ClientConfig {
3030

3131
#[derive(Debug, thiserror::Error)]
3232
#[error(transparent)]
33-
/// The error that can occur in [`TlsClientPolicyConfig::rustls_0_23_config`] when building a `rustls::ClientConfig`.
33+
/// The error that can occur in [`TlsClientPolicyConfig::rustls_0_23_config`] when building a
34+
/// [`rustls::ClientConfig`](https://docs.rs/rustls/0.23/rustls/client/struct.ClientConfig.html).
3435
pub struct Rustls023ConfigError(anyhow::Error);
3536

3637
impl TlsClientPolicyConfig {
37-
/// Build a [`rustls::ClientConfig`] according to the specified configuration.
38+
/// Build a [`rustls::ClientConfig`](https://docs.rs/rustls/0.23/rustls/client/struct.ClientConfig.html) according to the specified configuration.
3839
pub fn rustls_0_23_config(&self) -> Result<ClientConfig, Rustls023ConfigError> {
3940
fn _config(policy: &TlsClientPolicyConfig) -> Result<ClientConfig, anyhow::Error> {
4041
let provider = Arc::new(crypto_provider(&policy.crypto_provider)?);

0 commit comments

Comments
 (0)