* `Connection` is now parameterized over the stream type, which can be
any `AsyncRead + AsyncWrite`.
* The `TlsMode` enum is now a trait, and `NoTls`, `PreferTls`, and
`RequireTls` are types implementing that trait.
* The `TlsConnect` trait no longer involves trait objects, and returns
channel binding info alongside the stream type rather than requiring
the stream to implement an additional trait.
* The `connect` free function and `ConnectParams` type is gone in favor
of a `Builder` type. It takes a pre-connected stream rather than
automatically opening a TCP or Unix socket connection.
Notably, we no longer have any dependency on the Tokio runtime. We do
use the `tokio-codec` and `tokio-io` crates, but those don't actually
depend on mio/tokio-reactor/etc. This means we can work with other
futures-based networking stacks.
We will almost certainly add back a convenience API that offers
something akin to the old logic to open a TCP/Unix connection
automatically but that will be worked out in a follow up PR.
The TransactionBuilder is useful when trying to create a Transaction
around a future which takes ownership of the client. See doc comment
for more details.
Rolling back to a savepoint doesn't release it so,
reusing the same name in nested transaction means
inner transactions only roll back to the
most transaction/last savepoint.
If the outer most transaction commits but did multiple
consecutive rollbacks in the nested transactions this
did cause an unexpected state in the database before
the fix.
Someone forgot to handle the non unix case for this match which prevented a build on windows.
A similar line already existed here in line 51 to 56.
5ad7850009/tokio-postgres/src/stream.rs