Skip to content

Commit 6d8777d

Browse files
beneschpetrosagg
authored andcommitted
Optionally enable deriving Serialize/Deserialize
1 parent 95a1ef7 commit 6d8777d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tokio-postgres/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ pin-project-lite = "0.2"
5656
phf = "0.11"
5757
postgres-protocol = { version = "0.6.7", path = "../postgres-protocol" }
5858
postgres-types = { version = "0.2.7", path = "../postgres-types" }
59+
serde = { version = "1.0", optional = true }
5960
tokio = { version = "1.27", features = ["io-util"] }
6061
tokio-util = { version = "0.7", features = ["codec"] }
6162
rand = "0.8.5"

tokio-postgres/src/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ pub enum TargetSessionAttrs {
4141
}
4242

4343
/// TLS configuration.
44-
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
44+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
45+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4546
#[non_exhaustive]
4647
pub enum SslMode {
4748
/// Do not use TLS.

0 commit comments

Comments
 (0)