History

feat: in-manifest and in-lib documentation of feature toggles (#329)

Sebastian Thiel committed 4 years ago

Commit 39778fd1 parent 0826cc94 files · +26 −17Browse files

Unified · Split

4 files
  1. Cargo.lock +1 −0
  2. cargo-features.md +1 −13
  3. git-transport/Cargo.toml +19 −4
  4. git-transport/src/lib.rs +5 −0
Cargo.lock+1−0
@@ -1628,6 +1628,7 @@ dependencies = [ · 1627 unmodified lines
16281628 "blocking",
16291629 "bstr",
16301630 "curl",
1631+ "document-features",
16311632 "futures-io",
16321633 "futures-lite",
16331634 "git-features 0.19.1",
cargo-features.md+1−13
@@ -142,19 +142,7 @@ Documented in [its documentation](https://docs.rs/git-packetline). · 141 unmodified lines
142142
143143 ### git-transport
144144
145−The _client_ portion of transport can be blocking or async. If none is selected, it will be missing entirely.
146−
147−- _mutually exclusive_
148− - Specifying both causes a compile error, preventing the use of `--all-features`.
149− - **blocking-client**
150− - If set, blocking implementations of the typical git transports become available in `crate::client`
151− - **http-client-curl**
152− - Adds support for the http and https transports using the Rust bindings for `libcurl`
153− - **async-client**
154− - If set, an async implementations of the git transports becomes available in `crate::client`.
155− - Suitable for implementing your own transports while using git's way of communication, typically in conjunction with a custom server.
156− - **Note** that the _blocking_ client has a wide range of available transports, with the _async_ version of it supporting only the TCP based `git` transport leaving you
157− with the responsibility to providing such an implementation of `futures-io::AsyncRead/AsyncWrite` yourself.
145+Documented in [its documentation](https://docs.rs/git-transport).
158146
159147 ### git-protocol
160148
git-transport/Cargo.toml+19−4
@@ -13,12 +13,25 @@ doctest = false · 12 unmodified lines
1313
1414 [features]
1515 default = []
16−## Data structures implement `serde::Serialize` and `serde::Deserialize`.
17−serde1 = ["serde"]
18−http-client-curl = ["curl", "base64", "git-features/io-pipe", "blocking-client"]
16+
17+#! ### _Mutually Exclusive Client_
18+#! The _client_ portion of transport can be blocking or async. If none is selected, it will be missing entirely.
19+#! Specifying both causes a compile error, preventing the use of `--all-features`.
20+
21+## If set, blocking implementations of the typical git transports become available in `crate::client`
1922 blocking-client = ["git-packetline/blocking-io"]
23+## Implies `blocking-client`, and adds support for the http and https transports using the Rust bindings for `libcurl`.
24+http-client-curl = ["curl", "base64", "git-features/io-pipe", "blocking-client"]
25+## If set, an async implementations of the git transports becomes available in `crate::client`.
26+## Suitable for implementing your own transports while using git's way of communication, typically in conjunction with a custom server.
27+## **Note** that the _blocking_ client has a wide range of available transports, with the _async_ version of it supporting only the TCP based `git` transport leaving you
28+## with the responsibility to providing such an implementation of `futures-io::AsyncRead/AsyncWrite` yourself.
2029 async-client = ["git-packetline/async-io", "async-trait", "futures-lite", "futures-io", "pin-project-lite"]
2130
31+#! ### Other
32+## Data structures implement `serde::Serialize` and `serde::Deserialize`.
33+serde1 = ["serde"]
34+
2235 [[test]]
2336 name = "blocking-transport"
2437 path = "tests/blocking-transport.rs"
@@ -57,6 +70,8 @@ curl = { version = "0.4", optional = true, features = ["static-curl", "static-ss · 32 unmodified lines
5770 thiserror = "1.0.26"
5871 base64 = { version = "0.13.0", optional = true }
5972
73+document-features = { version = "0.1.0", optional = true }
74+
6075 [dev-dependencies]
6176 git-pack = { path = "../git-pack" }
6277 git-hash = { path = "../git-hash" }
@@ -65,4 +80,4 @@ maybe-async = "0.2.6" · 2 unmodified lines
6580 blocking = "1.0.2"
6681
6782 [package.metadata.docs.rs]
68−features = ["http-client-curl"]
83+features = ["http-client-curl", "document-features"]
git-transport/src/lib.rs+5−0
@@ -2,6 +2,11 @@ · 1 unmodified line
22 //! [`connect()`] to establish a connection given a repository URL.
33 //!
44 //! All git transports are supported, including `ssh`, `git`, `http` and `https`, as well as local repository paths.
5+//! ## Feature Flags
6+#![cfg_attr(
7+ feature = "document-features",
8+ cfg_attr(doc, doc = ::document_features::document_features!())
9+)]
510 #![forbid(unsafe_code)]
611 #![deny(rust_2018_idioms, missing_docs)]
712

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t