Skip to content

Commit 26987da

Browse files
authored
Merge pull request #1459 from wprzytula/document-features
Document features in `Cargo.toml`
2 parents fa5004d + f0e1e7f commit 26987da

File tree

5 files changed

+59
-30
lines changed

5 files changed

+59
-30
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ The driver supports the following:
6464

6565
For planned future improvements, see our [Milestones].
6666

67+
### Feature flags
68+
The driver has several optional features that can be enabled or disabled in `Cargo.toml`.
69+
Refer to [scylla/Cargo.toml](https://docs.rs/crate/scylla/latest/source/Cargo.toml.orig)
70+
for the list of available features and their descriptions.
71+
6772
## Getting Help
6873

6974
We invite you to discuss any issues and ask questions on the [ScyllaDB Forum] and the `#rust-driver` channel on [ScyllaDB Slack].

scylla-cql/Cargo.toml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,36 @@ rust-version = "1.85"
66
description = "CQL data types and primitives, for interacting with ScyllaDB."
77
repository = "https://github.com/scylladb/scylla-rust-driver"
88
readme = "../README.md"
9-
keywords = ["database", "scylla", "cql", "cassandra"]
9+
keywords = ["database", "scylla", "scylladb", "cql", "cassandra"]
1010
categories = ["database"]
1111
license = "MIT OR Apache-2.0"
1212

1313
[package.metadata."docs.rs"]
1414
all-features = true
1515

16+
[features]
17+
# Enables support for CQL ser/de of Secrecy type from secrecy 0.8 crate.
18+
secrecy-08 = ["dep:secrecy-08"]
19+
# Enables support for CQL ser/de of time/date types from time 0.3 crate.
20+
time-03 = ["dep:time-03"]
21+
# Enables support for CQL ser/de of time/date types from chrono 0.4 crate.
22+
chrono-04 = []
23+
# Enables support for CQL ser/de of arbitrary length integer types from num-bigint 0.3 crate.
24+
num-bigint-03 = ["dep:num-bigint-03"]
25+
# Enables support for CQL ser/de of arbitrary length integer types from num-bigint 0.4 crate.
26+
num-bigint-04 = ["dep:num-bigint-04"]
27+
# Enables support for CQL ser/de of arbitrary precision decimal types from bigdecimal 0.4 crate.
28+
bigdecimal-04 = ["dep:bigdecimal-04"]
29+
# Enables support for CQL ser/de of all supported external types.
30+
full-serialization = [
31+
"chrono-04",
32+
"time-03",
33+
"secrecy-08",
34+
"num-bigint-03",
35+
"num-bigint-04",
36+
"bigdecimal-04",
37+
]
38+
1639
[dependencies]
1740
###########################
1841
# Main, public dependencies
@@ -74,22 +97,6 @@ uuid = { version = "1.0", features = ["v4"] }
7497
name = "benchmark"
7598
harness = false
7699

77-
[features]
78-
secrecy-08 = ["dep:secrecy-08"]
79-
time-03 = ["dep:time-03"]
80-
chrono-04 = []
81-
num-bigint-03 = ["dep:num-bigint-03"]
82-
num-bigint-04 = ["dep:num-bigint-04"]
83-
bigdecimal-04 = ["dep:bigdecimal-04"]
84-
full-serialization = [
85-
"chrono-04",
86-
"time-03",
87-
"secrecy-08",
88-
"num-bigint-03",
89-
"num-bigint-04",
90-
"bigdecimal-04",
91-
]
92-
93100
[lints.rust]
94101
unnameable_types = "warn"
95102
unreachable_pub = "warn"

scylla-proxy/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name = "scylla-proxy"
33
version = "0.0.4"
44
edition = "2024"
55
rust-version = "1.85"
6-
description = "Proxy layer between Scylla driver and cluster that enables testing Scylla drivers' behaviour in unfavourable conditions"
6+
description = "Proxy layer between ScyllaDB driver and cluster that enables testing ScyllaDB drivers' behaviour in unfavourable conditions"
77
repository = "https://github.com/scylladb/scylla-rust-driver"
88
readme = "../README.md"
9-
keywords = ["database", "scylla", "cql", "cassandra"]
9+
keywords = ["database", "scylla", "scylladb", "cql", "cassandra"]
1010
categories = ["database"]
1111
license = "MIT OR Apache-2.0"
1212

scylla/Cargo.toml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name = "scylla"
33
version = "1.3.1"
44
edition = "2024"
55
rust-version = "1.85"
6-
description = "Async CQL driver for Rust, optimized for Scylla, fully compatible with Apache Cassandra™"
6+
description = "Async CQL driver for Rust, optimized for ScyllaDB, fully compatible with Apache Cassandra™"
77
repository = "https://github.com/scylladb/scylla-rust-driver"
88
readme = "../README.md"
9-
keywords = ["database", "scylla", "cql", "cassandra"]
9+
keywords = ["database", "scylla", "scylladb", "cql", "cassandra"]
1010
categories = ["database"]
1111
license = "MIT OR Apache-2.0"
1212

@@ -16,21 +16,31 @@ rustdoc-args = ["--cfg", "docsrs"]
1616

1717
[features]
1818
default = []
19+
# Enables TLS support via OpenSSL 0.10.
1920
openssl-010 = ["dep:tokio-openssl", "dep:openssl"]
21+
# Enables TLS support via rustls 0.23.
2022
rustls-023 = ["dep:tokio-rustls", "dep:rustls"]
23+
# Enables features required to work with Scylla Serverless Cloud.
2124
unstable-cloud = [
2225
"scylla-cql/serde",
2326
"dep:serde_yaml",
2427
"dep:serde",
2528
"dep:url",
2629
"dep:base64",
2730
]
31+
# Enables support for CQL ser/de of Secrecy type from secrecy 0.8 crate.
2832
secrecy-08 = ["scylla-cql/secrecy-08"]
33+
# Enables support for CQL ser/de of time/date types from chrono 0.4 crate.
2934
chrono-04 = ["scylla-cql/chrono-04"]
35+
# Enables support for CQL ser/de of time/date types from time 0.3 crate.
3036
time-03 = ["scylla-cql/time-03"]
37+
# Enables support for CQL ser/de of arbitrary length integer types from num-bigint 0.3 crate.
3138
num-bigint-03 = ["scylla-cql/num-bigint-03"]
39+
# Enables support for CQL ser/de of arbitrary length integer types from num-bigint 0.4 crate.
3240
num-bigint-04 = ["scylla-cql/num-bigint-04"]
41+
# Enables support for CQL ser/de of arbitrary precision decimal types from bigdecimal 0.4 crate.
3342
bigdecimal-04 = ["scylla-cql/bigdecimal-04"]
43+
# Enables support for CQL ser/de of all supported external types.
3444
full-serialization = [
3545
"chrono-04",
3646
"time-03",
@@ -39,7 +49,9 @@ full-serialization = [
3949
"num-bigint-04",
4050
"bigdecimal-04",
4151
]
52+
# Enables collection of internal driver metrics.
4253
metrics = ["dep:histogram"]
54+
# Opts-in to various unstable testing features.
4355
unstable-testing = []
4456

4557
[dependencies]
@@ -56,7 +68,7 @@ tokio = { version = "1.40", features = [
5668
"macros",
5769
] }
5870
tracing = "0.1.36"
59-
# Appears in various places of our public API
71+
# Appears in various places of our public API.
6072
bytes = "1.0.1"
6173
# Used for representing tracing ids and host ids.
6274
uuid = { version = "1.0", features = ["v4"] }

scylla/src/lib.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
//! Async Rust driver for the [Scylla](https://scylladb.com) database written in Rust.
2-
//! Although optimized for Scylla, the driver is also compatible with [Apache Cassandra®](https://cassandra.apache.org/).
1+
//! Async Rust driver for the [ScyllaDB](https://scylladb.com) database written in Rust.
2+
//! Although optimized for ScyllaDB, the driver is also compatible with [Apache Cassandra®](https://cassandra.apache.org/).
33
//!
44
//! # Documentation book
55
//! The best source to learn about this driver is the [documentation book](https://rust-driver.docs.scylladb.com/).\
6-
//! This page contains mainly API documentation
6+
//! This page contains mainly API documentation.
77
//!
88
//! # Other documentation
99
//! * [Documentation book](https://rust-driver.docs.scylladb.com/)
1010
//! * [Examples](https://github.com/scylladb/scylla-rust-driver/tree/main/examples)
11-
//! * [Scylla documentation](https://docs.scylladb.com)
11+
//! * [ScyllaDB documentation](https://docs.scylladb.com)
1212
//! * [Cassandra® documentation](https://cassandra.apache.org/doc/latest/)
1313
//!
1414
//! # Driver overview
1515
//! ### Connecting
16-
//! All driver activity revolves around the [Session](crate::client::session::Session)\
16+
//! All driver activity revolves around the [Session](crate::client::session::Session).\
1717
//! `Session` is created by specifying a few known nodes and connecting to them:
1818
//!
1919
//! ```rust,no_run
@@ -44,7 +44,7 @@
4444
//! * [Prepared paged](crate::client::session::Session::execute_iter)
4545
//! * [Batch](crate::client::session::Session::batch)
4646
//!
47-
//! To specify options for a single query create the query object and configure it:
47+
//! To specify options for a single query, create the corresponding object and configure it:
4848
//! * For simple: [`Statement`](crate::statement::unprepared::Statement)
4949
//! * For prepared: [`PreparedStatement`](crate::statement::prepared::PreparedStatement)
5050
//! * For batch: [`Batch`](crate::statement::batch::Batch)
@@ -74,7 +74,7 @@
7474
//! # use std::error::Error;
7575
//! # async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
7676
//!
77-
//! // Read rows containing an int and text
77+
//! // Read rows containing an int and text.
7878
//! // Keep in mind that all results come in one response (no paging is done!),
7979
//! // so the memory footprint and latency may be huge!
8080
//! // To prevent that, use `Session::query_iter` or `Session::query_single_page`.
@@ -90,7 +90,12 @@
9090
//! # Ok(())
9191
//! # }
9292
//! ```
93-
//! See the [book](https://rust-driver.docs.scylladb.com/stable/statements/result.html) for more receiving methods
93+
//! See the [book](https://rust-driver.docs.scylladb.com/stable/statements/result.html) for more receiving methods.
94+
//!
95+
//! # Feature flags
96+
//! The driver has several optional features that can be enabled or disabled in `Cargo.toml`.
97+
//! Refer to [scylla/Cargo.toml](https://docs.rs/crate/scylla/latest/source/Cargo.toml.orig)
98+
//! for the list of available features and their descriptions.
9499
95100
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
96101

0 commit comments

Comments
 (0)