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
1628 "blocking",1628 "blocking",
1629 "bstr",1629 "bstr",
1630 "curl",1630 "curl",
1631 "document-features",
1631 "futures-io",1632 "futures-io",
1632 "futures-lite",1633 "futures-lite",
1633 "git-features 0.19.1",1634 "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
142 142
143### git-transport143### git-transport
144 144
145The _client_ portion of transport can be blocking or async. If none is selected, it will be missing entirely.145Documented in [its documentation](https://docs.rs/git-transport).
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.
158 146
159### git-protocol147### git-protocol
160 148
git-transport/Cargo.toml+19−4
@@ -13,12 +13,25 @@ doctest = false · 12 unmodified lines
13 13
14[features]14[features]
15default = []15default = []
16## Data structures implement `serde::Serialize` and `serde::Deserialize`.16
17serde1 = ["serde"]17#! ### _Mutually Exclusive Client_
18http-client-curl = ["curl", "base64", "git-features/io-pipe", "blocking-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`
19blocking-client = ["git-packetline/blocking-io"]22blocking-client = ["git-packetline/blocking-io"]
23## Implies `blocking-client`, and adds support for the http and https transports using the Rust bindings for `libcurl`.
24http-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.
20async-client = ["git-packetline/async-io", "async-trait", "futures-lite", "futures-io", "pin-project-lite"]29async-client = ["git-packetline/async-io", "async-trait", "futures-lite", "futures-io", "pin-project-lite"]
21 30
31#! ### Other
32## Data structures implement `serde::Serialize` and `serde::Deserialize`.
33serde1 = ["serde"]
34
22[[test]]35[[test]]
23name = "blocking-transport"36name = "blocking-transport"
24path = "tests/blocking-transport.rs"37path = "tests/blocking-transport.rs"
@@ -57,6 +70,8 @@ curl = { version = "0.4", optional = true, features = ["static-curl", "static-ss · 32 unmodified lines
57thiserror = "1.0.26"70thiserror = "1.0.26"
58base64 = { version = "0.13.0", optional = true }71base64 = { version = "0.13.0", optional = true }
59 72
73document-features = { version = "0.1.0", optional = true }
74
60[dev-dependencies]75[dev-dependencies]
61git-pack = { path = "../git-pack" }76git-pack = { path = "../git-pack" }
62git-hash = { path = "../git-hash" }77git-hash = { path = "../git-hash" }
@@ -65,4 +80,4 @@ maybe-async = "0.2.6" · 2 unmodified lines
65blocking = "1.0.2"80blocking = "1.0.2"
66 81
67[package.metadata.docs.rs]82[package.metadata.docs.rs]
68features = ["http-client-curl"]83features = ["http-client-curl", "document-features"]
git-transport/src/lib.rs+5−0
@@ -2,6 +2,11 @@ · 1 unmodified line
2//! [`connect()`] to establish a connection given a repository URL.2//! [`connect()`] to establish a connection given a repository URL.
3//!3//!
4//! All git transports are supported, including `ssh`, `git`, `http` and `https`, as well as local repository paths.4//! 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)]
5#![forbid(unsafe_code)]10#![forbid(unsafe_code)]
6#![deny(rust_2018_idioms, missing_docs)]11#![deny(rust_2018_idioms, missing_docs)]
7 12

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