Skip to content

Show feature gated bindings in documentaion #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ exclude = [
]
categories = ["web-programming", "encoding", "data-structures"]

# Enable all features when building on docs.rs to show feature gated bindings
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lib]
name = "cloudevents"

Expand Down
19 changes: 19 additions & 0 deletions src/binding/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
//! Provides protocol binding implementations for [`crate::Event`].

#[cfg_attr(docsrs, doc(cfg(feature = "actix")))]
#[cfg(feature = "actix")]
pub mod actix;
#[cfg_attr(docsrs, doc(cfg(feature = "axum")))]
#[cfg(feature = "axum")]
pub mod axum;

#[cfg_attr(
docsrs,
doc(cfg(any(
feature = "http-binding",
feature = "actix",
feature = "warp",
feature = "reqwest",
feature = "axum",
feature = "poem"
)))
)]
#[cfg(any(
feature = "http-binding",
feature = "actix",
Expand All @@ -13,14 +27,19 @@ pub mod axum;
feature = "poem"
))]
pub mod http;
#[cfg_attr(docsrs, doc(cfg(feature = "nats")))]
#[cfg(feature = "nats")]
pub mod nats;
#[cfg_attr(docsrs, doc(cfg(feature = "poem")))]
#[cfg(feature = "poem")]
pub mod poem;
#[cfg_attr(docsrs, doc(cfg(feature = "rdkafka")))]
#[cfg(feature = "rdkafka")]
pub mod rdkafka;
#[cfg_attr(docsrs, doc(cfg(feature = "reqwest")))]
#[cfg(feature = "reqwest")]
pub mod reqwest;
#[cfg_attr(docsrs, doc(cfg(feature = "warp")))]
#[cfg(feature = "warp")]
pub mod warp;

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@

#![doc(html_root_url = "https://docs.rs/cloudevents-sdk/0.5.0")]
#![deny(rustdoc::broken_intra_doc_links)]
#![cfg_attr(docsrs, feature(doc_cfg))] // Show feature gate in doc

pub mod binding;
pub mod event;
Expand Down