Skip to content

Commit 80e2485

Browse files
authored
RUST-849 Remove extra fields from ConnectionPoolOptions included in CMAP events (#367)
1 parent 6dda93d commit 80e2485

File tree

3 files changed

+2
-39
lines changed

3 files changed

+2
-39
lines changed

src/cmap/options.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,9 @@ impl ConnectionPoolOptions {
109109

110110
pub(crate) fn to_event_options(&self) -> EventOptions {
111111
EventOptions {
112-
app_name: self.app_name.clone(),
113-
connect_timeout: self.connect_timeout,
114-
driver_info: self.driver_info.clone(),
115112
max_idle_time: self.max_idle_time,
116113
min_pool_size: self.min_pool_size,
117114
max_pool_size: self.max_pool_size,
118-
server_api: self.server_api.clone(),
119-
tls_options: self.tls_options.clone(),
120115
}
121116
}
122117
}

src/cmap/test/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,9 @@ impl Matchable for TlsOptions {
346346

347347
impl Matchable for EventOptions {
348348
fn content_matches(&self, expected: &EventOptions) -> bool {
349-
self.app_name.matches(&expected.app_name)
350-
&& self.connect_timeout.matches(&expected.connect_timeout)
351-
&& self.max_idle_time.matches(&expected.max_idle_time)
349+
self.max_idle_time.matches(&expected.max_idle_time)
352350
&& self.max_pool_size.matches(&expected.max_pool_size)
353351
&& self.min_pool_size.matches(&expected.min_pool_size)
354-
&& self.tls_options.matches(&expected.tls_options)
355352
}
356353
}
357354

src/event/cmap.rs

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ use std::time::Duration;
55

66
use serde::Deserialize;
77

8-
use crate::{
9-
client::options::{DriverInfo, ServerApi, TlsOptions},
10-
options::ServerAddress,
11-
};
8+
use crate::options::ServerAddress;
129

1310
/// We implement `Deserialize` for all of the event types so that we can more easily parse the CMAP
1411
/// spec tests. However, we have no need to parse the address field from the JSON files (if it's
@@ -41,20 +38,6 @@ pub struct PoolCreatedEvent {
4138
#[serde(rename_all = "camelCase")]
4239
#[non_exhaustive]
4340
pub struct ConnectionPoolOptions {
44-
/// The application name specified by the user. This is sent to the server as part of the
45-
/// handshake that each connection makes when it's created.
46-
pub app_name: Option<String>,
47-
48-
/// The connect timeout passed to each underlying TcpStream when attempting to connect to the
49-
/// server.
50-
#[serde(skip)]
51-
pub connect_timeout: Option<Duration>,
52-
53-
/// Extra information to append to the driver version in the metadata of the handshake with the
54-
/// server. This should be used by libraries wrapping the driver, e.g. ODMs.
55-
#[serde(skip)]
56-
pub driver_info: Option<DriverInfo>,
57-
5841
/// Connections that have been ready for usage in the pool for longer than `max_idle_time` will
5942
/// not be used.
6043
///
@@ -76,18 +59,6 @@ pub struct ConnectionPoolOptions {
7659
///
7760
/// The default is that no minimum is enforced
7861
pub min_pool_size: Option<u32>,
79-
80-
/// The declared API version
81-
///
82-
/// The default value is to have no declared API version
83-
pub(crate) server_api: Option<ServerApi>,
84-
85-
/// The options specifying how a TLS connection should be configured. If `tls_options` is
86-
/// `None`, then TLS will not be used for the connections.
87-
///
88-
/// The default is not to use TLS for connections.
89-
#[serde(skip)]
90-
pub tls_options: Option<TlsOptions>,
9162
}
9263

9364
/// Event emitted when a connection pool becomes ready.

0 commit comments

Comments
 (0)