Skip to content

Commit 187b361

Browse files
authored
RUST-1138 Add bson-serde_with feature flag (#580)
1 parent 6e7accb commit 187b361

File tree

3 files changed

+27
-22
lines changed

3 files changed

+27
-22
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ sync = ["async-std-runtime"]
2828
# Enable support for v0.4 of the chrono crate in the public API of the BSON library.
2929
bson-chrono-0_4 = ["bson/chrono-0_4"]
3030

31+
# Enable support for the serde_with crate in the BSON library.
32+
bson-serde_with = ["bson/serde_with"]
33+
3134
# Enable support for v0.8 of the uuid crate in the public API of the BSON library.
3235
bson-uuid-0_8 = ["bson/uuid-0_8"]
3336

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,18 @@ features = ["sync"]
6262

6363
### All Feature Flags
6464

65-
| Feature | Description | Extra dependencies | Default |
66-
|:--------------------|:--------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------|:--------|
67-
| `tokio-runtime` | Enable support for the `tokio` async runtime | `tokio` 1.0 with the `full` feature | yes |
68-
| `async-std-runtime` | Enable support for the `async-std` runtime | `async-std` 1.0 | no |
69-
| `sync` | Expose the synchronous API (`mongodb::sync`). This flag cannot be used in conjunction with either of the async runtime feature flags. | `async-std` 1.0 | no |
70-
| `aws-auth` | Enable support for the MONGODB-AWS authentication mechanism. | `reqwest` 0.11 | no |
71-
| `bson-uuid-0_8` | Enable support for v0.8 of the [`uuid`](docs.rs/uuid/0.8) crate in the public API of the re-exported `bson` crate. | n/a | no |
72-
| `bson-chrono-0_4` | Enable support for v0.4 of the [`chrono`](docs.rs/chrono/0.4) crate in the public API of the re-exported `bson` crate. | n/a | no |
73-
| `zlib-compression` | Enable support for compressing messages with [`zlib`](https://zlib.net/) | `flate2` 1.0 | no |
74-
| `zstd-compression` | Enable support for compressing messages with [`zstd`](http://facebook.github.io/zstd/). This flag requires Rust version 1.54. | `zstd` 0.9.0 | no |
75-
| `snappy-compression`| Enable support for compressing messages with [`snappy`](http://google.github.io/snappy/) | `snap` 1.0.5 | no |
65+
| Feature | Description | Extra dependencies | Default |
66+
|:---------------------|:--------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------|:--------|
67+
| `tokio-runtime` | Enable support for the `tokio` async runtime | `tokio` 1.0 with the `full` feature | yes |
68+
| `async-std-runtime` | Enable support for the `async-std` runtime | `async-std` 1.0 | no |
69+
| `sync` | Expose the synchronous API (`mongodb::sync`). This flag cannot be used in conjunction with either of the async runtime feature flags. | `async-std` 1.0 | no |
70+
| `aws-auth` | Enable support for the MONGODB-AWS authentication mechanism. | `reqwest` 0.11 | no |
71+
| `bson-uuid-0_8` | Enable support for v0.8 of the [`uuid`](docs.rs/uuid/0.8) crate in the public API of the re-exported `bson` crate. | n/a | no |
72+
| `bson-chrono-0_4` | Enable support for v0.4 of the [`chrono`](docs.rs/chrono/0.4) crate in the public API of the re-exported `bson` crate. | n/a | no |
73+
| `bson-serde_with` | Enable support for the [`serde_with`](docs.rs/serde_with/latest) crate in the public API of the re-exported `bson` crate. | `serde_with` 1.0 | no |
74+
| `zlib-compression` | Enable support for compressing messages with [`zlib`](https://zlib.net/) | `flate2` 1.0 | no |
75+
| `zstd-compression` | Enable support for compressing messages with [`zstd`](http://facebook.github.io/zstd/). This flag requires Rust version 1.54. | `zstd` 0.9.0 | no |
76+
| `snappy-compression` | Enable support for compressing messages with [`snappy`](http://google.github.io/snappy/) | `snap` 1.0.5 | no |
7677

7778
## Example Usage
7879
Below are simple examples of using the driver. For more specific examples and the API reference, see the driver's [docs.rs page](https://docs.rs/mongodb/latest).

src/lib.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,18 @@
5050
//!
5151
//! ### All Feature flags
5252
//!
53-
//! | Feature | Description | Extra dependencies | Default |
54-
//! |:--------------------|:--------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------|:--------|
55-
//! | `tokio-runtime` | Enable support for the `tokio` async runtime | `tokio` 1.0 with the `full` feature | yes |
56-
//! | `async-std-runtime` | Enable support for the `async-std` runtime | `async-std` 1.0 | no |
57-
//! | `sync` | Expose the synchronous API (`mongodb::sync`). This flag cannot be used in conjunction with either of the async runtime feature flags. | `async-std` 1.0 | no |
58-
//! | `aws-auth` | Enable support for the MONGODB-AWS authentication mechanism. | `reqwest` 0.11 | no |
59-
//! | `bson-uuid-0_8` | Enable support for v0.8 of the [`uuid`] crate in the public API of the re-exported `bson` crate. | n/a | no |
60-
//! | `bson-chrono-0_4` | Enable support for v0.4 of the [`chrono`] crate in the public API of the re-exported `bson` crate. | n/a | no |
61-
//! | `zlib-compression`] | Enable support for compressing messages with [`zlib`](https://zlib.net/). | `flate2` 1.0 | no |
62-
//! | `zstd-compression` | Enable support for compressing messages with [`zstd`](http://facebook.github.io/zstd/). This flag requires Rust version 1.54. | `zstd` 0.9.0 | no |
63-
//! | `snappy-compression` | Enable support for compressing messages with [`snappy`](http://google.github.io/snappy/). | `snap` 1.0.5 | no |
53+
//! | Feature | Description | Extra dependencies | Default |
54+
//! |:---------------------|:--------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------|:--------|
55+
//! | `tokio-runtime` | Enable support for the `tokio` async runtime | `tokio` 1.0 with the `full` feature | yes |
56+
//! | `async-std-runtime` | Enable support for the `async-std` runtime | `async-std` 1.0 | no |
57+
//! | `sync` | Expose the synchronous API (`mongodb::sync`). This flag cannot be used in conjunction with either of the async runtime feature flags. | `async-std` 1.0 | no |
58+
//! | `aws-auth` | Enable support for the MONGODB-AWS authentication mechanism. | `reqwest` 0.11 | no |
59+
//! | `bson-uuid-0_8` | Enable support for v0.8 of the [`uuid`](docs.rs/uuid/0.8) crate in the public API of the re-exported `bson` crate. | n/a | no |
60+
//! | `bson-chrono-0_4` | Enable support for v0.4 of the [`chrono`](docs.rs/chrono/0.4) crate in the public API of the re-exported `bson` crate. | n/a | no |
61+
//! | `bson-serde_with` | Enable support for the [`serde_with`](docs.rs/serde_with/latest) crate in the public API of the re-exported `bson` crate. | `serde_with` 1.0 | no |
62+
//! | `zlib-compression` | Enable support for compressing messages with [`zlib`](https://zlib.net/) | `flate2` 1.0 | no |
63+
//! | `zstd-compression` | Enable support for compressing messages with [`zstd`](http://facebook.github.io/zstd/). This flag requires Rust version 1.54. | `zstd` 0.9.0 | no |
64+
//! | `snappy-compression` | Enable support for compressing messages with [`snappy`](http://google.github.io/snappy/) | `snap` 1.0.5 | no |
6465
//!
6566
//! # Example Usage
6667
//!

0 commit comments

Comments
 (0)