Repository navigation
docs: add doc(cfg) annotations for feature-gated APIs - #109
Merged
Merged
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
iainmcgin
approved these changes
May 18, 2026
iainmcgin
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the contribution!
iainmcgin
enabled auto-merge (squash)
May 18, 2026 18:27
Add `#[cfg_attr(docsrs, doc(cfg(...)))]` to feature-gated public API items across `client`, `client-tls`, `server`, `server-tls`, `gzip`, `zstd`, `streaming`, and `axum` surfaces so docs.rs renders the "Available on crate feature ... only" badges. The convention is to annotate the minimal cfg expression after Cargo feature implications collapse (e.g. `client-tls` rather than `all(client, client-tls)` since `client-tls` enables `client`), and use `all(...)` only when neither feature implies the other (e.g. the `StreamingCompressionProvider` impls require both `gzip`/`zstd` and `streaming`). Fixes connectrpc#102. Co-authored-by: Ruifeng Xue <129142497+Yong-yuan-X@users.noreply.github.com>
iainmcgin
force-pushed
the
fix/docsrs-doc-cfg-102
branch
from
May 18, 2026 19:48
eedba89 to
b494843
Compare
iainmcgin
disabled auto-merge
May 18, 2026 19:50
iainmcgin
enabled auto-merge (squash)
May 18, 2026 19:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
doc(cfg(...))annotations to feature-gated public API items.#[cfg(...)]gates and avoid generated files.Fixes #102.
Verification
rustfmt --edition 2024 --check connectrpc/src/lib.rs connectrpc/src/compression.rs connectrpc/src/client/mod.rs connectrpc/src/client/http2.rs connectrpc/src/response.rs connectrpc/src/server.rs connectrpc/src/service.rscargo check -p connectrpc --all-features --all-targetscargo doc -p connectrpc --all-features --no-depsWorkspace commands attempted but blocked locally because
protocis not installed/on PATH:cargo check --workspace --all-features --all-targetscargo doc --workspace --all-features --no-deps