The driver currently has a single Connection type that is used for both monitoring connections and pooled connections. Pooled connections have a lot of extra data associated with them however (generation, event handler, pool manager, etc). When creating monitoring connections, these fields have to be None or contain placeholder values, which are error-prone and hard to reason about.
We should introduce a new type PooledConnection which contains all that extra, pool-specific data and wraps something similar to our existing Connection type. We can then remove all the pool specific data from it and use it directly in the monitors.
- is related to
-
RUST-727 Include separate types for handshaked and non-handshaked connections
- Backlog